Skip to content

System.Security.Cryptography.Aes has some strange APIs, which make it difficult to use. #109887

Discussion options

You must be logged in to vote

The parent class of type Aes, SymmetricAlgorithm, implements the IDisposable interface, which is only used to clear array elements. I think it is unnecessary.

Even were it "unnecessary", it can't stop being IDisposable.

Clearing the key out is important for some people, particularly anyone who has to operate under FedRAMP/FIPS/FISMA data processing standards, which dictate that a secret key must be removed from memory when it is no longer necessary.

And also, that implementation is just the base class behavior. Implementations like AesCryptoServiceProvider in .NET Framework have interop considerations... specifically, SafeHandle values that should be disposed. Sure, those values could b…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Vincent-X-Zhang
Comment options

Comment options

You must be logged in to vote
2 replies
@Vincent-X-Zhang
Comment options

@tfenise
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Vincent-X-Zhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants