Skip to content

.NET Standard 2.0 implementation of AES-CTR, AES-CMAC, and SIV-AES (aka AES-SIV).

License

Notifications You must be signed in to change notification settings

dorssel/dotnet-aes-extra

Repository files navigation

dotnet-aes-extra

Build CodeQL MegaLinter codecov REUSE status NuGet

.NET Standard 2.0 implementation of the following AES modes that are not included in .NET 6.0 / .NET Framework:

  • AES-CTR, as defined by NIST SP 800-38A
  • AES-CMAC, as defined by NIST SP 800-38B
  • SIV-AES, as defined by RFC 5297
    (Note: this is often refered to as AES-SIV, but the original RFC specification uses the name SIV-AES)

The implementation is for AnyCPU, and works on all platforms.

Usage

The released binary NuGet packages and the .NET assemblies contained therein:

All public classes are in the Dorssel.Security.Cryptography namespace.

  • AesCtr is modeled after .NET's Aes. So, instead of Aes.Create(), use AesCtr.Create().
  • AesCmac is modeled after .NET's HMACSHA256. So, instead of new HMACSHA256(key), use new AesCmac(key).
  • AesSiv is modeled after .NET's AesGcm. So, instead of new AesGcm(key), use new AesSiv(key).