Search code examples
cryptographybase-class-librarysystem.security

Is the AES key good enough?


When the System.Security.Cryptography.Aes.Create(algorithmName) method is called, a new key and IV are generated. Are these good enough to use?


Solution

  • Those values are safe to use. The whole purpose of frameworks like this one is to make the generation of cryptographically random values easier. Aes.Create() is also used in the sample code

    Additionally, the documentation describes Aes.Create():

    Creates a cryptographic object that is used to perform the symmetric algorithm.

    This library is maintained by Microsoft, I think it is safe to say their values are "safe" to use.