예제 #1
0
 /// <summary>
 /// Encrypt text with a given password.  Returns string in Base64 format.  (Internally use RijindaelManaged encryptor)
 /// </summary>
 /// <param name="plainText">Text that will be encrypted</param>
 /// <param name="password">Password will be used to encrypt the text</param>
 /// <returns>Encrypted text in Base64 format</returns>
 public static string Encode(string plainText, string password)
 {
     byte[] plainBytes = CryptoUtils.ToBytes(plainText, StringFormat.Unicode);
     byte[] encryptedBytes = Encode(plainBytes, password);
     return CryptoUtils.FromBytes(encryptedBytes, _defaultStringFormat);
 }