/// <summary> /// Encrypts a string using the Rijndael algo and encodes it into base64 format. /// Plaintext, salt, passphrase and initialization vectors are provided. /// </summary> /// <param name="text">The text to encrypt</param> /// <param name="passPhrase">The pass phrase used for this encryption</param> /// <param name="saltValue">The salt value used for this encryption</param> /// <param name="initVector">The init vector used for this encryption (must be 16 bit)</param> /// <param name="hashAlgorithm">The hash algorithm used for this encryption</param> /// <param name="keySize">The size of the key used for this encryption.</param> /// <param name="passWordIterations"> /// Number of iterations used to generate password. One or two iterations /// should be enough.</param> /// <returns></returns> public static string AES_Simple_Encrypt(string text, string passPhrase, string saltValue , string initVector, RijndaelSimpleHashAlgorithm hashAlgorithm, RijndaelSimpleKeySize keySize, int passWordIterations) { return(RijndaelSimple.Encrypt(text, passPhrase, saltValue, hashAlgorithm.ToString(), passWordIterations, initVector, (int)keySize)); }
/// <summary> /// /// </summary> /// <param name="pTextToEncrypt"></param> /// <param name="pPassPhrase"></param> /// <param name="pInitVector"></param> /// <param name="pSaltValue"></param> /// <returns></returns> public static string AES_Simple_Encrypt(string pTextToEncrypt, string pPassPhrase, string pInitVector, string pSaltValue) { return(RijndaelSimple.Encrypt(pTextToEncrypt, pPassPhrase, pSaltValue, pInitVector)); }