public void TestLegacyDeriveKey() { string pass = "******"; byte[] passBytes = Encoding.UTF8.GetBytes(pass); byte[] key1 = new byte[32]; StreamEncryptor.LegacyDeriveKey(passBytes, key1, 32); byte[] key2 = { 0x7b, 0x14, 0xff, 0x93, 0xd6, 0x63, 0x27, 0xfa, 0xd4, 0xdc, 0x37, 0x86, 0x46, 0x86, 0x3f, 0xc4, 0x53, 0x04, 0xd0, 0xdb, 0xf3, 0x79, 0xbd, 0xb5, 0x54, 0x44, 0xf9, 0x91, 0x80, 0x50, 0x7e, 0xa2 }; string key1str = Convert.ToBase64String(key1); string key2str = Convert.ToBase64String(key2); Assert.IsTrue(key1str == key2str); }
public void DeriveKey(byte[] password, byte[] key, int keylen) { StreamEncryptor.LegacyDeriveKey(password, key, keylen); }