A simple class that makes it easier to do few basic crypto tasks.
At this stage, its quite basic, and its hardcoded to use Rijndael as a symmetric algorithm.
Functionality so far:
- Encrypting/Decrypting byte arrays.
- Encrypting/Decrypting strings.
- Encrypting/Decrypting files.
- Encrypting/Decrypting streams.
- Random Key and IV generation
- Extension methods to convert back and to Base64 and Hex Encoded strings
Plans for future expansion are underway.
You can find the build package on nuget here: https://www.nuget.org/packages/CryptoN
var key = CryptoMonkey.GenerateRandomKey(AllowedKeySizes.KL_192); var iv = CryptoMonkey.GenerateRandomIv(AllowedBlockSizes.BL_128); var monkey = new CryptoMonkey(key, iv); var testString = "Hello World"; var encryptedBase64String = monkey.EncryptString(testString); var decryptedString = monkey.DecryptString(encryptedBase64String);