RC2 decryption is not work for unique combination.

Sep 28 2010 9:42 AM
Hello evenryone,

In one of my web application i used the RC2 encryption / decryption for password. I use email id as key. Suddenly i found that it gives error for one unique password (12345678) and email id ([email protected]).
Application perform encryption successfully but when i try to decrypt my password again it gives error "System.Security.Cryptography.CryptographicException: Length of the data to decrypt is invalid.
   at System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
   at System.Security.Cryptography.CryptoStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.StreamReader.ReadBuffer()
   at System.IO.StreamReader.ReadToEnd()"

If i do any changes in email id or password it works perfectly.

Is there is some problem with RC2 decryption for some values?

Please help me to fix this error.

Answers (1)