AES implementation of symmetric key encryption Rijndael using
RJCryptrj=newRJCrypt();stringpassword="eUCX6V54eTr?C8M";// The password to encrypt the data withstringplaintext="Text";// The string to encrypt// Encrypt the stringstringciphertext=rj.Encrypt(plaintext,password,RJCrypt.Common.KeySize.Aes256);// Decrypt the stringplaintext=rj.Decrypt(ciphertext,password,RJCrypt.Common.KeySize.Aes256);stringpassword="eUCX6V54eTr?C8M";// The password to encrypt the data withstringplaintext="Text";// The string to encrypt// Encrypt the stringstringaeCiphertext=rj.Encrypt(plaintext,password,RJCrypt.Common.KeySize.Aes256);// Decrypt the stringplaintext=rj.Decrypt(aeCiphertext,password,RJCrypt.Common.KeySize.Aes256);stringpassword="eUCX6V54eTr?C8M";// The password to encrypt the file withstringplaintextFile=@"D:\Photo.png";// The file to encryptstringciphertextFile=@"D:\ProtectedFiles";// The encrypted file (extension unnecessary)// Encrypt the filerj.Encrypt(plaintextFile,ciphertextFile,password,RJCrypt.Common.KeySize.Aes256);// Decrypt the filerj.Decrypt(ciphertextFile,plaintextFile,password,RJCrypt.Common.KeySize.Aes256);The Settings class is a set of default values that are changed in the library. Changing these settings by default is not required, but is available for developers who want more precise control of the Rijndael256 encryption system.
// The HashIterations setting is used in several places throughout the lib,// with Rijndael.Encrypt being just one of them. After making this change,// any future calls to Rijndael.Encrypt will make use of this new valueSettings.HashIterations=25000;// To reset all the settings to their default valuesSettings.Reset();- Author: Shamsudin Serderov
- Version Library: 1.0.0
- Email: sourcecode@steein.ru