Why are RijndaelManaged and AesCryptoServiceProvider returning different results?

后端 未结 3 824
心在旅途
心在旅途 2020-12-02 08:39

Here is the example that I have run. It has the same Mode, Padding, BlockSize, KeySize. I am using the same init vector, key and data.

Using the RijndaelManaged pr

3条回答
  •  伪装坚强ぢ
    2020-12-02 09:20

    I think it has to do with the CipherMode.CFB. See this post describing AesManaged:

    AesManaged is actually just a wrapper around RinjdaelManaged with some code added to make sure that you do not setup the algorithm to operate in a non-AES compatible way. For instance, AesManaged does not allow you to change the block size. (It will also disallow the use of CFB and OFB mode because of the way that RijndaelManaged works with those modes).

    Note that if you use CipherMode.ECB or CipherMode.CBC, you'll see identical results. Any reason why you need CFB and not CBC?

提交回复
热议问题