.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 do I need to use a different library altogether?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.