A .Core AES extensions.
- 1.Extensions of RSA
- 2.Compatible with Java
- 3.BC model provide more than .net CLI
Thanks for bcgit's bc-csharp
Install-Package CandyJun.Aes
var aes = System.Security.Cryptography.Aes.Create();
aes.Mode = CipherMode.ECB;
aes.Padding = PaddingMode.PKCS7;
aes.BlockSize = 128;
//Generate key equal java SecureRandom (double SHA1)
aes.GenerateKey(8);
aes.GenerateIV(8);
var source = "test";
//Encrypt with csharp system library
var encCsharp = aes.Encrypt(source);
//Encrypt with BC library,params as string
var encBC = aes.EncryptBC(source, "AES/ECB/PKCS7");
//Decrypt with csharp system library
var strCsharp = aes.Decrypt(encCsharp, mode: CipherMode.ECB);
//Decrypt with BC library,params as enum
var strBC = aes.DecryptBC(encCsharp, CipherModeBC.ECB, CipherPaddingBC.PKCS7);
bc-csharp - bcgit
- Add project