<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Very simple encryption example with VBScript</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/very-simple-encryption-example-with-vbscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/very-simple-encryption-example-with-vbscript/</link>
	<description></description>
	<pubDate>Mon, 09 Nov 2009 07:45:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Rahulji</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/very-simple-encryption-example-with-vbscript/#comment-54</link>
		<dc:creator>Rahulji</dc:creator>
		<pubDate>Mon, 29 Jun 2009 05:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/very-simple-encryption-example-with-vbscript/#comment-54</guid>
		<description>Hi,
Very good work.
Can you please give me a similar script wich uses any 128 bit encryption algorithm?
this will really help me with my work.

thanks in Advance
Rahul
rahuljiv@yahoo.co.in</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Very good work.<br />
Can you please give me a similar script wich uses any 128 bit encryption algorithm?<br />
this will really help me with my work.</p>
<p>thanks in Advance<br />
Rahul<br />
&nbsp;&lt;a href="mailto:rahuljiv@yahoo.co.in" title="mailto:rahuljiv@yahoo.co.in"&gt;rahuljiv at yahoo.co.in&lt;/a&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TonyLongson</title>
		<link>http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/very-simple-encryption-example-with-vbscript/#comment-37</link>
		<dc:creator>TonyLongson</dc:creator>
		<pubDate>Fri, 12 Dec 2008 09:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/very-simple-encryption-example-with-vbscript/#comment-37</guid>
		<description>Nice work Jerry. You can change the script to cope with characters up to ASCII 255 by a slight change incorporating modular arithmetic:

[CODE]
Function encrypt(Str, key)
 Dim lenKey, KeyPos, LenStr, x, Newstr, EncCharNum
 
 Newstr = “”
 lenKey = Len(key)
 KeyPos = 1
 LenStr = Len(Str)
 str = StrReverse(str)
 For x = 1 To LenStr
      EncCharNum = Asc (Mid (str, x, 1)) + Asc (Mid (key, KeyPos, 1))
      Newstr = Newstr &#38; chr(EncCharNum Mod 256)
      KeyPos = keypos+1
      If KeyPos &#62; lenKey Then KeyPos = 1
 Next
 encrypt = Newstr
End Function

Function Decrypt(str,key)
 Dim lenKey, KeyPos, LenStr, x, Newstr, DecCharNum
 
 Newstr = “”
 lenKey = Len(key)
 KeyPos = 1
 LenStr = Len(Str)
 
 str=StrReverse(str)
 For x = LenStr To 1 Step -1
      DecCharNum = Asc (Mid (str, x, 1)) - Asc (Mid (key,KeyPos, 1)) + 256
      Newstr = Newstr &#38; chr(DecCharNum Mod 256)
      KeyPos = KeyPos+1
      If KeyPos &#62; lenKey Then KeyPos = 1
      Next
      Newstr=StrReverse(Newstr)
      Decrypt = Newstr
End Function
[/CODE]

This basically "wraps around" the value to always generate a code between 0 and 255.

The only issue then is that you may get control characters in the encrypted string, so you probably couldn't store an encrypted value within the script itself unless you encoded it with vb constants or Chr calls, e.g.
[CODE]
 EncData = "Abc" + vbNull + "%£" &#38; Chr (19) &#38; "xyz"
[/CODE]</description>
		<content:encoded><![CDATA[<p>Nice work Jerry. You can change the script to cope with characters up to ASCII 255 by a slight change incorporating modular arithmetic:</p>
<pre>
Function encrypt(Str, key)
 Dim lenKey, KeyPos, LenStr, x, Newstr, EncCharNum

 Newstr = “”
 lenKey = Len(key)
 KeyPos = 1
 LenStr = Len(Str)
 str = StrReverse(str)
 For x = 1 To LenStr
      EncCharNum = Asc (Mid (str, x, 1)) + Asc (Mid (key, KeyPos, 1))
      Newstr = Newstr &amp; chr(EncCharNum Mod 256)
      KeyPos = keypos+1
      If KeyPos &gt; lenKey Then KeyPos = 1
 Next
 encrypt = Newstr
End Function

Function Decrypt(str,key)
 Dim lenKey, KeyPos, LenStr, x, Newstr, DecCharNum

 Newstr = “”
 lenKey = Len(key)
 KeyPos = 1
 LenStr = Len(Str)

 str=StrReverse(str)
 For x = LenStr To 1 Step -1
      DecCharNum = Asc (Mid (str, x, 1)) - Asc (Mid (key,KeyPos, 1)) + 256
      Newstr = Newstr &amp; chr(DecCharNum Mod 256)
      KeyPos = KeyPos+1
      If KeyPos &gt; lenKey Then KeyPos = 1
      Next
      Newstr=StrReverse(Newstr)
      Decrypt = Newstr
End Function
</pre>
<p>This basically &#8220;wraps around&#8221; the value to always generate a code between 0 and 255.</p>
<p>The only issue then is that you may get control characters in the encrypted string, so you probably couldn&#8217;t store an encrypted value within the script itself unless you encoded it with vb constants or Chr calls, e.g.</p>
<pre>
 EncData = &#8220;Abc&#8221; + vbNull + &#8220;%£&#8221; &amp; Chr (19) &amp; &#8220;xyz&#8221;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- dynamic -->