Can I use AES in CTR mode in .NET?

前端 未结 5 568
被撕碎了的回忆
被撕碎了的回忆 2020-12-10 01:45

.NET\'s AES does not implement CTR directly. It only implements CBC, CFB, CTS, ECB and OFB.

Can I use any of these modes and securely implement CTR around them, or

5条回答
  •  孤街浪徒
    2020-12-10 01:56

    Yes, you can build a CTR using .NET's AES in ECB mode and a counter, that you yourself initialize and increment, for each block encrypted.

    An example of this is the WinZipAes encryption stream, which is part of the open-source DotNetZip.
    WinZip specifies the use of AES encryption for encrypted ZIP files, using AES in CTR mode. DotNetZip implements the CTR mode using ECB and the counter.

    See here for some comments.

提交回复
热议问题