When would I choose AesCryptoServiceProvider over AesManaged or RijndaelManaged?

邮差的信 提交于 2019-12-19 05:23:46

问题


I think the distinguishing factors are

  • AesCryptoServiceProvider is FIPS compliant
  • AesManaged is cross-platform, requires .NET 3.0
  • RijndaelManaged runs on .NET 2.0, requires restricting the blocksize

is that about right?


回答1:


AesManaged documentation states that

"The AES algorithm is essentially the Rijndael symmetric algorithm with a fixed block size and iteration count. This class functions the same way as the RijndaelManaged class but limits blocks to 128 bits and does not allow feedback modes."

That would suggest its using ECB (Electronic Codebook) mode. This can be a significant weakness to the encrypted data as it means identical blocks of plain text data will result in identical blocks of cipher output.


Edit: (As correction)
Documentation for the Mode property indicates that Mode infact defaults to CBC (which confusingly IS a feedback mode) but cannot be set to CFB or OFB (Cipher Feedback / Output Feedback)



来源:https://stackoverflow.com/questions/1228451/when-would-i-choose-aescryptoserviceprovider-over-aesmanaged-or-rijndaelmanaged

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!