Click to See Complete Forum and Search --> : DES api


chatou
August 16th, 2004, 09:54 AM
Anyone any ideas ! (HELP)

is it possible to use the microsotf DES api in the simplest form of the DES, i.e without an IV (initialisation vector).
I want use an 8 byte key to encrypt an 8 byte block of data without a IV

Cheers !

f1shrman
August 16th, 2004, 07:58 PM
It looks like you can call SymmetricAlgorithm.CreateEncryptor Method () passing null for both the key and initialization vector.



[C++]
public: virtual ICryptoTransform* CreateEncryptor();

Return Value
A symmetric encryptor object.

Remarks
If the current Key is a null reference (Nothing in Visual Basic), GenerateKey is called to create a new random Key. If the current IV is a null reference (Nothing), GenerateIV is called to create a new random IV.

Use the CreateDecryptor overload with the same signature to decrypt the result of this method.



The initialization vector will still be created - you just don't specify what it is. So, I am not sure you will gain much by not knowing what the IV is - seems to me that it may be difficult to decrypt with out knowing the IV.

Link to msdn DES crypto..... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographydescryptoserviceproviderclasstopic.asp

HTH.