コード例 #1
0
        public string Decrypt(string cipherText, string password)
        {
            var encryptedBytes = Convert.FromBase64String(cipherText);

            return(Encoding.UTF8.GetString(
                       Decrypt(
                           encryptedBytes,
                           SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize)
                           )
                       ));
        }
コード例 #2
0
        public string Encrypt(string plainText, string password)
        {
            var plainBytes = Encoding.UTF8.GetBytes(plainText);

            return(Convert.ToBase64String(
                       Encrypt(
                           plainBytes,
                           SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize)
                           )
                       ));
        }
コード例 #3
0
 public byte [] Decrypt(byte [] ciphertext, string password)
 {
     return(Decrypt(ciphertext, SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize)));
 }
コード例 #4
0
 public byte [] Encrypt(byte [] plaintext, string password)
 {
     return(Encrypt(plaintext, SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize)));
 }