Skip to content

MirzaCryptoHelpers Verified Level 2 (v2.3.0). A Lightweight helper library to perform common cryptographic operations in .NET 4.5 above.

License

Notifications You must be signed in to change notification settings

mirzaevolution/MirzaCryptoHelpersV2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MirzaCryptoHelpers Verified Level 2 (v2.3.0)

Lightweight helper library to perform common cryptographic operations. This helper library is wrapper from existing .NET framework library and was created to ease development when we have to deal with cryptography operations, hashing and conversions by simply wrapping all the related operations found in .NET Framework into streamlined classes, methods and extension methods.

In this version (2.3.0) we fixed a few bugs and added 2 new classes:

  1. RSACryptoMachineKeyStore
  2. BitComparer

Examples:

  1. Converting string to binary and otherwise:
using MirzaCryptoHelpers.Extensions;

string hello = "Hello";
string helloInBin = hello.ToBinary(); // 1001000 1100101 1101100 1101100 1101111
string helloFromBin = helloInBin.FromBinary(); //it'll be converted back to "Hello"
  1. Encrypt string using AES with password:
using MirzaCryptoHelpers.SymmetricCryptos;
using MirzaCryptoHelpers.Common;

string input = "Hello World!";
string password = "P@s$w0rD~!";
byte[] cipherInBytes = new AESCrypto().Encrypt(
    BitHelpers.ConvertStringToBytes(input), password
);  //byte[16] { 6, 186, 118, 13, 202, 18, 116, 245, 127, 199, 186, 125, 9, 117, 187, 9 }
string cipherInBase64 =  BitHelpers.ConvertToBase64String(cipherInBytes); //Brp2DcoSdPV/x7p9CXW7CQ==

string plain = BitHelpers.ConvertBytesToString(
	new AESCrypto().Decrypt(
    		BitHelpers.ConvertFromBase64String(cipherInBase64), password
        )
   ); //Hello World!

And many other helpers available. Ready? Take a look our wiki

Install from Nuget.Org

Old Version:

Install-Package MirzaCryptoHelpersV2 -Version 2.0.0
Install-Package MirzaCryptoHelpersV2 -Version 2.3.0

Best Regards,

Mirza Ghulam Rasyid.

About

MirzaCryptoHelpers Verified Level 2 (v2.3.0). A Lightweight helper library to perform common cryptographic operations in .NET 4.5 above.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages