<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Encrypting and Decrypting a C# string</title>
	<atom:link href="http://www.dijksterhuis.org/encrypting-decrypting-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dijksterhuis.org/encrypting-decrypting-string/</link>
	<description>Information, news about programming in C#</description>
	<lastBuildDate>Sat, 04 Jun 2011 10:24:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Ales</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-12895</link>
		<dc:creator>Ales</dc:creator>
		<pubDate>Sat, 04 Jun 2011 10:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-12895</guid>
		<description>Hi,

Thanks for the code... I must say I did not experience any errors decrypting any of my messages. I even tried &quot;wwwrw&quot; with salt &quot;jomaih&quot; as well as various strings containing spaces and all worked well.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for the code&#8230; I must say I did not experience any errors decrypting any of my messages. I even tried &#8220;wwwrw&#8221; with salt &#8220;jomaih&#8221; as well as various strings containing spaces and all worked well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kiran Tailor</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-10661</link>
		<dc:creator>Kiran Tailor</dc:creator>
		<pubDate>Fri, 13 May 2011 06:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-10661</guid>
		<description>Hi,

Great encrypt and decrypt by TripleDES algoritham. 

Thanks.

I tried with RijndaelManaged algoritham, that&#039;s also working fine.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Great encrypt and decrypt by TripleDES algoritham. </p>
<p>Thanks.</p>
<p>I tried with RijndaelManaged algoritham, that&#8217;s also working fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bian</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-6627</link>
		<dc:creator>bian</dc:creator>
		<pubDate>Thu, 17 Mar 2011 02:18:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-6627</guid>
		<description>how to get passphase if i have encrypt and decrypt string??
Thanks alot</description>
		<content:encoded><![CDATA[<p>how to get passphase if i have encrypt and decrypt string??<br />
Thanks alot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edson Catugy</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-6099</link>
		<dc:creator>Edson Catugy</dc:creator>
		<pubDate>Fri, 11 Feb 2011 17:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-6099</guid>
		<description>Very useful information!!</description>
		<content:encoded><![CDATA[<p>Very useful information!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: An</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-5707</link>
		<dc:creator>An</dc:creator>
		<pubDate>Sun, 23 Jan 2011 05:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-5707</guid>
		<description>another issue that if message string contain special characters then Error occurs

Example: message=&quot;Ñ³÷YïÁ¡g/&quot;;

Invalid character in a Base-64 string

// Step 4. Convert the input string to a byte[]
byte[] DataToDecrypt = Convert.FromBase64String(Message);</description>
		<content:encoded><![CDATA[<p>another issue that if message string contain special characters then Error occurs</p>
<p>Example: message=&#8221;Ñ³÷YïÁ¡g/&#8221;;</p>
<p>Invalid character in a Base-64 string</p>
<p>// Step 4. Convert the input string to a byte[]<br />
byte[] DataToDecrypt = Convert.FromBase64String(Message);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samir</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-5557</link>
		<dc:creator>Samir</dc:creator>
		<pubDate>Sun, 16 Jan 2011 10:06:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-5557</guid>
		<description>Thanks a lot for nice and easy to use functions.</description>
		<content:encoded><![CDATA[<p>Thanks a lot for nice and easy to use functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Berenguer</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-4629</link>
		<dc:creator>Jon Berenguer</dc:creator>
		<pubDate>Fri, 05 Nov 2010 21:54:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-4629</guid>
		<description>Thanks for the Post. 
I started to get some errors when the encrypted message had a space character into. 

After doing some research, it seems that the convert part in step 4 of the decryption method does not like spaces. 

Before step 4, I replace the space to a &quot;+&quot;, according to other sources the plus sign is the same as a space and it works perfectly.


// Step 3. Setup the decoder
TDESAlgorithm.Key = TDESKey;
TDESAlgorithm.Mode = CipherMode.ECB;
TDESAlgorithm.Padding = PaddingMode.PKCS7;

//Fix for base64 error when message has a space, This is the line of code to add
Message = Message.Replace(&quot; &quot;, &quot;+&quot;);

// Step 4. Convert the input string to a byte[]
byte[] DataToDecrypt = Convert.FromBase64String(Message);</description>
		<content:encoded><![CDATA[<p>Thanks for the Post.<br />
I started to get some errors when the encrypted message had a space character into. </p>
<p>After doing some research, it seems that the convert part in step 4 of the decryption method does not like spaces. </p>
<p>Before step 4, I replace the space to a &#8220;+&#8221;, according to other sources the plus sign is the same as a space and it works perfectly.</p>
<p>// Step 3. Setup the decoder<br />
TDESAlgorithm.Key = TDESKey;<br />
TDESAlgorithm.Mode = CipherMode.ECB;<br />
TDESAlgorithm.Padding = PaddingMode.PKCS7;</p>
<p>//Fix for base64 error when message has a space, This is the line of code to add<br />
Message = Message.Replace(&#8221; &#8220;, &#8220;+&#8221;);</p>
<p>// Step 4. Convert the input string to a byte[]<br />
byte[] DataToDecrypt = Convert.FromBase64String(Message);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Osama Mortada</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-4264</link>
		<dc:creator>Osama Mortada</dc:creator>
		<pubDate>Sat, 02 Oct 2010 22:59:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-4264</guid>
		<description>Hi,

Thanks for this tutorial it&#039;s really good but sometimes I get this error:

// Step 4. Convert the input string to a byte[]
byte[] DataToDecrypt = Convert.FromBase64String(Message);

Invalid length for a Base-64 char array.

I tried it with this string &quot;wwwrw&quot;
secret string &quot;jomaih&quot;

Thank you,</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for this tutorial it&#8217;s really good but sometimes I get this error:</p>
<p>// Step 4. Convert the input string to a byte[]<br />
byte[] DataToDecrypt = Convert.FromBase64String(Message);</p>
<p>Invalid length for a Base-64 char array.</p>
<p>I tried it with this string &#8220;wwwrw&#8221;<br />
secret string &#8220;jomaih&#8221;</p>
<p>Thank you,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vance</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-4000</link>
		<dc:creator>Vance</dc:creator>
		<pubDate>Sat, 11 Sep 2010 00:16:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-4000</guid>
		<description>Thanks! Good to find simple encryption techniques for stings, as they are useful for keeping cookies private. Many other pages just deal with https instead of manually encrypting strings.</description>
		<content:encoded><![CDATA[<p>Thanks! Good to find simple encryption techniques for stings, as they are useful for keeping cookies private. Many other pages just deal with https instead of manually encrypting strings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Berenguer</title>
		<link>http://www.dijksterhuis.org/encrypting-decrypting-string/comment-page-1/#comment-3612</link>
		<dc:creator>Jon Berenguer</dc:creator>
		<pubDate>Mon, 09 Aug 2010 22:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.dijksterhuis.org/?p=453#comment-3612</guid>
		<description>Thanks for the lesson and source code. While using the above codes I experience some errors decrypting some messages, especially when it contained some spaces. After searching the internets, I found a fix. Apparently when converting from a Base64 string to byte, it does not like the space in the message. I inserted this line of code, in between Step 3 and 4 for the decrypt method: 

Message = Message.Replace(&quot; &quot;, &quot;+&quot;); 

Hope this helps others who experience this issue.</description>
		<content:encoded><![CDATA[<p>Thanks for the lesson and source code. While using the above codes I experience some errors decrypting some messages, especially when it contained some spaces. After searching the internets, I found a fix. Apparently when converting from a Base64 string to byte, it does not like the space in the message. I inserted this line of code, in between Step 3 and 4 for the decrypt method: </p>
<p>Message = Message.Replace(&#8221; &#8220;, &#8220;+&#8221;); </p>
<p>Hope this helps others who experience this issue.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

