none
PasswordDeriveBytes.CryptDeriveKey derives an AES key but gets "Object identifier (OID) is unknown" RRS feed

  • Question

  • Hi all,
    I'm using PasswordDeriveBytes class to derive an AES cipher key with the following code:
                RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
                byte[] salt = new byte[8];
                rng.GetBytes(salt);
                PasswordDeriveBytes pdb = new PasswordDeriveBytes(keyHash, salt);
                aes.Key = pdb.CryptDeriveKey("AES", "SHA1", 128, aes.IV);

    however, it comes with an CryptographicException with the message: Object identifier (OID) is unknown
    So what's the valid name for "AES" algorithm? I'm using AES 128. Thanks~
    Wednesday, October 28, 2009 3:38 AM

Answers

  • Problem solved. I disassembled mscorlib.dll, PasswordDerivedBytes.CryptDeriveKey does not support AES.
    • Marked as answer by eryang Thursday, October 29, 2009 8:19 AM
    Thursday, October 29, 2009 3:53 AM

All replies

  • Is it that the .net wrapper doesn't support AES?
    Wednesday, October 28, 2009 7:15 AM
  • Problem solved. I disassembled mscorlib.dll, PasswordDerivedBytes.CryptDeriveKey does not support AES.
    • Marked as answer by eryang Thursday, October 29, 2009 8:19 AM
    Thursday, October 29, 2009 3:53 AM