The VNC Manager - SmartCode Solutions Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Passing RC4 key data into HTML via... Expand / Collapse
Author
Message
Posted 1/23/2009 11:33:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/26/2009 7:05:26 AM
Posts: 8, Visits: 16
I am trying to use the new security property KeyData to pass the RC4 key to the client without the need of an external file, but I can't seem to get the syntax correct.  I have truncated the HEX version of the key because obviously I don't want that to show up in a forum post.

Am I entering the key properly?  Should there be a space in between every HEX char?  I was also struggling on how to convert the key generated by VNC to a format usable by this ActiveX.  I found an online converter that changed the text string from the file into a HEX format.  Should this work?  Is there a better to get a HEX string out of that file?

Can someone show me the correct syntax to define this property in HTML?

<HTML>
 <HEAD>
  <TITLE>VNC Viewer Website</TITLE>
  <script language="Javascript">;
   function OnConnect() {
    window.ViewerX.Disconnect()
    window.ViewerX.HostIP = document.VNCViewer.Address.value
    window.ViewerX.Port = document.VNCViewer.Port.value
    window.ViewerX.Connect()
   }
   function OnDisconnect() {
    window.ViewerX.Disconnect()
   }
   function OnCAD() {
    window.ViewerX.SendCAD()
   }
   function OnRefresh() {
    window.ViewerX.RequestRefresh()
   }
   function OnFit() {
    window.ViewerX.StretchMode = 1
   }
   function OnNormal() {
    window.ViewerX.StretchMode = 0
   }
   function OnFullColor() {
    window.ViewerX.RestrictPixel = 0
   }
   function On8Bit() {
    window.ViewerX.RestrictPixel = 1
   }
  </script>
 </HEAD>
 <BODY>
  <h2 align="center">VNC Viewer Control</h2>
  <hr>
  <form name="VNCViewer">
   IP address:&nbsp<input id="Address" type="text" size="15" value="HOSTNAME">
   Port:&nbsp<input id="Port" type="text" size="6" value="5900">
   &nbsp&nbsp&nbsp
   <input onclick="OnConnect()" type="button" value="Connect"> &nbsp; <input onclick="OnDisconnect()" type="button" value="Disconnect">
  </p>
  </form>
  <hr>
  <p><input onclick="OnCAD()" type="button" value="Ctl+Alt+Del">
  <input onclick="OnRefresh()" type="button" value="Refresh">
  <input onclick="OnFit()" type="button" value="Size to Screen">
  <input onclick="OnNormal()" type="button" value="Size to 100%">
  <input onclick="OnFullColor()" type="button" value="Full Color">
  <input onclick="On8Bit()" type="button" value="8bit Color"></p>
  <p>
   <OBJECT id="ViewerX" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
    width="800" height="600" classid="CLSID:62FA83F7-20EC-4D62-AC86-BAB705EE1CCD" VIEWASTEXT CodeBase="viewerx.cab">
    <PARAM NAME="HostIP" VALUE="">
    <PARAM NAME="Port" VALUE="5900">
    <PARAM NAME="Password" VALUE="">
    <PARAM NAME="CustomCompression" VALUE="1">
    <PARAM NAME="CustomCompressionLevel" VALUE="5">
    <PARAM NAME="JPEGCompression" VALUE="1">
    <PARAM NAME="JPEGCompressionLevel" VALUE="5">
    <PARAM NAME="CopyRect" VALUE="1">
    <PARAM NAME="EmulateThreeButton" VALUE="1">
    <PARAM NAME="SwapMouseButtons" VALUE="0">
    <PARAM NAME="Encoding" VALUE="7">
    <PARAM NAME="ViewOnly" VALUE="0">
    <PARAM NAME="RestrictPixel" VALUE="0">
    <PARAM NAME="ScaleNum" VALUE="1">
    <PARAM NAME="ScaleDen" VALUE="1">
    <PARAM NAME="ScaleEnable" VALUE="0">
    <PARAM NAME="FullScreen" VALUE="0">
    <PARAM NAME="LocalCursor" VALUE="1">
    <PARAM NAME="MessageBoxes" VALUE="1">
    <PARAM NAME="DisableClipboard" VALUE="0">
    <PARAM NAME="ThumbnailMode" VALUE="0">
    <PARAM NAME="LoginType" VALUE="1">
    <PARAM NAME="MsUser" VALUE="">
    <PARAM NAME="MsDomain" VALUE="">
    <PARAM NAME="MsPassword" VALUE="">
    <PARAM NAME="ProxyIP" VALUE="">
    <PARAM NAME="ProxyPort" VALUE="-1">
    <PARAM NAME="ProxyUser" VALUE="">
    <PARAM NAME="ProxyPassword" VALUE="">
    <PARAM NAME="ProxyType" VALUE="0">
    <PARAM NAME="ConnectionBar" VALUE="1">
    <PARAM NAME="StretchMode" VALUE="0">
    <PARAM NAME="UVNCS_EnableSecurity" VALUE="1">
    <PARAM NAME="UVNCS_KeyStorage" VALUE="1">
    <PARAM NAME="UVNCS_KeyData" VALUE="31 32 38 20 62 69 74 ...">
   </OBJECT>
  </p>
 </BODY>
</HTML>

Post #2378
Posted 1/24/2009 4:02:33 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
UVNCS_KeyData expects SAFEARRAY of bytes and in your code your are passing a string to it. There is a VBscript function that allows to convert sting to SAFEARRAY of bytes. Sorry I'm not so good at VBscript so I cannot tell you exactly which method you should use, but if you google for it you sure will be able to find it.

Otherwise you might want to use UVNCS_KeyDataAsHexStr property instead. It accepts RC4 key if form of string of HEX values.



Kindest Regards,
SmartCode Solutions Support
Post #2379
Posted 1/26/2009 7:09:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/26/2009 7:05:26 AM
Posts: 8, Visits: 16
Can I see a code example showing the syntax on passing a HEX value into the UVNCS_KeyDataAsHexStr property?  Nothing I have tried is working.
Post #2383
Posted 1/26/2009 7:27:31 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2 days ago @ 7:10:09 PM
Posts: 1,163, Visits: 1,909
Sure, I'll post sample C# project tomorrow.



Kindest Regards,
SmartCode Solutions Support
Post #2384
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Support (s-code), Alex (s-code)

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 6:45am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.203. 9 queries. Compression Disabled.