0

I used RijndaelManaged encryption for encrypt password. I used this this encrypt and decrypt code. http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged(v=vs.110).aspx Few questions i need to clarify

What is the use of ivalue that we are passing to these methods. i got the understanding about key. but i could not understand why we are using this(I used key and ivalue with same value)

for some key values it shows. {"Specified key is not a valid size for this algorithm."} why i am getting this error. is there any specified length value for this?

Bruce
  • 8,609
  • 8
  • 54
  • 83

1 Answers1

0

If you want simple, Rijandael is a block algorithm where you use previously encrypted block, to encrypt next one. Ivalue(Vector) used to encrypt first block in the input text. Thats why length of vector must be equal to length of block.

You might want to read about Initialization vector

Uriil
  • 11,948
  • 11
  • 47
  • 68
  • for key length of 1,2 it shows "Specified key is not a valid size for this algorithm.". how to resolve this? – Bruce Mar 31 '14 at 09:10
  • From msdn: This algorithm supports key lengths of 128, 192, or 256 bits. Default 256 bits(32 bytes), default vector size 16 bytes – Uriil Mar 31 '14 at 09:20