public string Decrypt(byte[] keyPassword, string encryptedText)
 {
     try
     {
         return(RijndaelAlgorithm.Decrypt(encryptedText, InitVector, keyPassword));
     } catch (Exception ex)
     {
         return(null);
     }
 }
 public string Decrypt(string password, string encryptedText)
 {
     try
     {
         return(RijndaelAlgorithm.Decrypt(encryptedText, password, SaltValue, _hashAlgorithm, PasswordIterations, InitVector, _keySize));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 public string Encrypt(byte[] keyPassword, string text)
 {
     return(RijndaelAlgorithm.Encrypt(text, InitVector, keyPassword));
 }
        public byte[] GetIndividualKeyInBytes(byte[] keyPassword, byte[] individualSalt)
        {
            var password = Convert.ToBase64String(keyPassword);

            return(RijndaelAlgorithm.GetKeyInBytes(password, individualSalt, _hashAlgorithm, 10, _keySize));
        }
 public byte[] GetKeyInBytes(string password)
 {
     return(RijndaelAlgorithm.GetKeyInBytes(password, SaltValue, _hashAlgorithm, PasswordIterations, _keySize));
 }