ramon
April 22nd, 2004, 05:55
Hi,
I have the following C# code <<attached>>, the class SaferKn encrypts and decrypts blocks bytes, it is Safer-K128 with 10 rounds.
if I do:
byte[] array1_crypted;
byte[] array1_decrypted;
byte[] array1 = new byte[] { (byte)'H', (byte)'e', (byte)'l', (byte)'l', (byte)'o' };
SaferKn MyCipher = new SaferKn();
array1_crypted = MyCipher.EncryptBlock(array1);
array1_decrypted = MyCipher.DecryptBlock(array1_crypted);
then I can see that "array1_decrypted == array1 == Hello" as expected,
but if I use MyCipher.KeyScheduling(...) with my own userkey1 and userkey2
before encrypt/decrypt then "array1_decrypted != array1" will be different!!!
Sorry if I'm missing something basic here, but if the users keys are the same, why "array1_decrypted != array1", the userkey1 and userkey2 is not the same for encrypt and decrypt? If not how to retrieve decrypt user keys if I know the encrypt keys?
thank u for your attention,
Ramon
I have the following C# code <<attached>>, the class SaferKn encrypts and decrypts blocks bytes, it is Safer-K128 with 10 rounds.
if I do:
byte[] array1_crypted;
byte[] array1_decrypted;
byte[] array1 = new byte[] { (byte)'H', (byte)'e', (byte)'l', (byte)'l', (byte)'o' };
SaferKn MyCipher = new SaferKn();
array1_crypted = MyCipher.EncryptBlock(array1);
array1_decrypted = MyCipher.DecryptBlock(array1_crypted);
then I can see that "array1_decrypted == array1 == Hello" as expected,
but if I use MyCipher.KeyScheduling(...) with my own userkey1 and userkey2
before encrypt/decrypt then "array1_decrypted != array1" will be different!!!
Sorry if I'm missing something basic here, but if the users keys are the same, why "array1_decrypted != array1", the userkey1 and userkey2 is not the same for encrypt and decrypt? If not how to retrieve decrypt user keys if I know the encrypt keys?
thank u for your attention,
Ramon