Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encryption '.IV' Value 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I have tried a few bits of code that are scattere over the internet demonstrating how to encrypt text and decrypt it.
I know enough to make it work but I'd like to understand it better. The bit that confuses me is the 'IV' paramerter
commonly used in VB.Net encryption classes.

If I were to define an occurrance of an encryption class such as the TripleDESCryptoServiceProvider, it has a property
of '.key' and 'IV'. I have read a number of web pages decsribing what 'IV' is but I get lost very quickly. Can anybody sum it up in simple terms what it does?

Also should I always set the 'IV' to a vlaue as some of the web page examples I have used just leave as blank.



Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Put simply it improves the encryption by, in conjunction with the Key, randomizing the data in the first block of input data (future blocks use output from the previous block to achieve this, but clearly the first block has no previous block)

Your decryptor needs to be initialised with the same Key and IV to be able to get back the plaintext

Note that when you create a TripleDESCryptoServiceProvider it generates an initial Key and an initial IV (which is why you might see examples that don't bother setting this property) - and these will remain in force during the lifetime of the TripleDESCryptoServiceProvider.
 
Thanks. That was the concise level of explanation I was looking for.

Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top