﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SmartCode Solutions Web Forum » SmartCode ViewerX VNC Viewer ActiveX » General Discussion  » Passing RC4 key data into HTML via UVNCS_KeyData</title><generator>InstantForum.NET 2010-3</generator><description>SmartCode Solutions Web Forum</description><link>http://www.s-code.com/forum/</link><webMaster>SmartCode Solutions Web Forum</webMaster><lastBuildDate>Sat, 31 Jul 2010 19:22:00 GMT</lastBuildDate><ttl>20</ttl><item><title>Passing RC4 key data into HTML via UVNCS_KeyData</title><link>http://www.s-code.com/forum/FindPost2378.aspx</link><description>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.&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;Can someone show me the correct syntax to define this property in HTML?&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;&amp;lt;HTML&amp;gt;&lt;BR&gt; &amp;lt;HEAD&amp;gt;&lt;BR&gt;  &amp;lt;TITLE&amp;gt;VNC Viewer Website&amp;lt;/TITLE&amp;gt;&lt;BR&gt;  &amp;lt;script language="Javascript"&amp;gt;;&lt;BR&gt;   function OnConnect() {&lt;BR&gt;    &amp;#119;indow.ViewerX.Disconnect()&lt;BR&gt;    &amp;#119;indow.ViewerX.HostIP = &amp;#100;ocument.VNCViewer.Address.value&lt;BR&gt;    &amp;#119;indow.ViewerX.Port = &amp;#100;ocument.VNCViewer.Port.value&lt;BR&gt;    &amp;#119;indow.ViewerX.Connect()&lt;BR&gt;   }&lt;BR&gt;   function OnDisconnect() {&lt;BR&gt;    &amp;#119;indow.ViewerX.Disconnect()&lt;BR&gt;   }&lt;BR&gt;   function OnCAD() {&lt;BR&gt;    &amp;#119;indow.ViewerX.SendCAD()&lt;BR&gt;   }&lt;BR&gt;   function OnRefresh() {&lt;BR&gt;    &amp;#119;indow.ViewerX.RequestRefresh()&lt;BR&gt;   }&lt;BR&gt;   function OnFit() {&lt;BR&gt;    &amp;#119;indow.ViewerX.StretchMode = 1&lt;BR&gt;   }&lt;BR&gt;   function OnNormal() {&lt;BR&gt;    &amp;#119;indow.ViewerX.StretchMode = 0&lt;BR&gt;   }&lt;BR&gt;   function OnFullColor() {&lt;BR&gt;    &amp;#119;indow.ViewerX.RestrictPixel = 0&lt;BR&gt;   }&lt;BR&gt;   function On8Bit() {&lt;BR&gt;    &amp;#119;indow.ViewerX.RestrictPixel = 1&lt;BR&gt;   }&lt;BR&gt;  &amp;lt;/script&amp;gt;&lt;BR&gt; &amp;lt;/HEAD&amp;gt;&lt;BR&gt; &amp;lt;BODY&amp;gt;&lt;BR&gt;  &amp;lt;h2 align="center"&amp;gt;VNC Viewer Control&amp;lt;/h2&amp;gt;&lt;BR&gt;  &amp;lt;hr&amp;gt;&lt;BR&gt;  &amp;lt;form name="VNCViewer"&amp;gt;&lt;BR&gt;   IP address:&amp;amp;nbsp&amp;lt;input id="Address" type="text" size="15" value="HOSTNAME"&amp;gt;&lt;BR&gt;   Port:&amp;amp;nbsp&amp;lt;input id="Port" type="text" size="6" value="5900"&amp;gt;&lt;BR&gt;   &amp;amp;nbsp&amp;amp;nbsp&amp;amp;nbsp&lt;BR&gt;   &amp;lt;input &amp;#111;nclick="OnConnect()" type="button" value="Connect"&amp;gt; &amp;amp;nbsp; &amp;lt;input &amp;#111;nclick="OnDisconnect()" type="button" value="Disconnect"&amp;gt;&lt;BR&gt;  &amp;lt;/p&amp;gt;&lt;BR&gt;  &amp;lt;/form&amp;gt;&lt;BR&gt;  &amp;lt;hr&amp;gt;&lt;BR&gt;  &amp;lt;p&amp;gt;&amp;lt;input &amp;#111;nclick="OnCAD()" type="button" value="Ctl+Alt+Del"&amp;gt;&lt;BR&gt;  &amp;lt;input &amp;#111;nclick="OnRefresh()" type="button" value="Refresh"&amp;gt;&lt;BR&gt;  &amp;lt;input &amp;#111;nclick="OnFit()" type="button" value="Size to Screen"&amp;gt;&lt;BR&gt;  &amp;lt;input &amp;#111;nclick="OnNormal()" type="button" value="Size to 100%"&amp;gt;&lt;BR&gt;  &amp;lt;input &amp;#111;nclick="OnFullColor()" type="button" value="Full Color"&amp;gt;&lt;BR&gt;  &amp;lt;input &amp;#111;nclick="On8Bit()" type="button" value="8bit Color"&amp;gt;&amp;lt;/p&amp;gt;&lt;BR&gt;  &amp;lt;p&amp;gt;&lt;BR&gt;   &amp;lt;OBJECT id="ViewerX" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"&lt;BR&gt;    width="800" height="600" classid="CLSID:62FA83F7-20EC-4D62-AC86-BAB705EE1CCD" VIEWASTEXT CodeBase="viewerx.cab"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="HostIP" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="Port" VALUE="5900"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="Password" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="CustomCompression" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="CustomCompressionLevel" VALUE="5"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="JPEGCompression" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="JPEGCompressionLevel" VALUE="5"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="CopyRect" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="EmulateThreeButton" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="SwapMouseButtons" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="Encoding" VALUE="7"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ViewOnly" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="RestrictPixel" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ScaleNum" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ScaleDen" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ScaleEnable" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="FullScreen" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="LocalCursor" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="MessageBoxes" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="DisableClipboard" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ThumbnailMode" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="LoginType" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="MsUser" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="MsDomain" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="MsPassword" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ProxyIP" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ProxyPort" VALUE="-1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ProxyUser" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ProxyPassword" VALUE=""&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ProxyType" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="ConnectionBar" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="StretchMode" VALUE="0"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="UVNCS_EnableSecurity" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="UVNCS_KeyStorage" VALUE="1"&amp;gt;&lt;BR&gt;    &amp;lt;PARAM NAME="UVNCS_KeyData" VALUE="31 32 38 20 62 69 74 ..."&amp;gt;&lt;BR&gt;   &amp;lt;/OBJECT&amp;gt;&lt;BR&gt;  &amp;lt;/p&amp;gt;&lt;BR&gt; &amp;lt;/BODY&amp;gt;&lt;BR&gt;&amp;lt;/HTML&amp;gt;&lt;/P&gt;&lt;P&gt;[/code]</description><pubDate>Mon, 26 Jan 2009 07:27:31 GMT</pubDate><dc:creator>Bonji</dc:creator></item><item><title>RE: Passing RC4 key data into HTML via UVNCS_KeyData</title><link>http://www.s-code.com/forum/FindPost2384.aspx</link><description>Sure, I'll post sample C# project tomorrow.</description><pubDate>Mon, 26 Jan 2009 07:27:31 GMT</pubDate><dc:creator>Support (s-code)</dc:creator></item><item><title>RE: Passing RC4 key data into HTML via UVNCS_KeyData</title><link>http://www.s-code.com/forum/FindPost2383.aspx</link><description>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.</description><pubDate>Mon, 26 Jan 2009 07:09:35 GMT</pubDate><dc:creator>Bonji</dc:creator></item><item><title>RE: Passing RC4 key data into HTML via UVNCS_KeyData</title><link>http://www.s-code.com/forum/FindPost2379.aspx</link><description>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.&lt;br&gt;&lt;br&gt;Otherwise you might want to use UVNCS_KeyDataAsHexStr property instead. It accepts RC4 key if form of string of HEX values.</description><pubDate>Sat, 24 Jan 2009 04:02:33 GMT</pubDate><dc:creator>Support (s-code)</dc:creator></item></channel></rss>