Esempio n. 1
0
            private static AesCryptoServiceProvider GetAesCryptoServiceProvider(string password)
            {
                AesCryptoServiceProvider sa = new AesCryptoServiceProvider();

                FishCryptoService.SetKeyIV(sa, password);
                return(sa);
            }
Esempio n. 2
0
            private static TripleDESCryptoServiceProvider GetTripleDESCryptoServiceProvider(string password)
            {
                TripleDESCryptoServiceProvider sa = new TripleDESCryptoServiceProvider();

                FishCryptoService.SetKeyIV(sa, password);
                return(sa);
            }
Esempio n. 3
0
 public static byte[] Decrypt(byte[] input, string password)
 {
     return(FishCryptoService.Decrypt(input, GetAesCryptoServiceProvider(password)));
 }
Esempio n. 4
0
 public static string Decrypt(string base64, string password)
 {
     return(FishCryptoService.Decrypt(base64, GetAesCryptoServiceProvider(password)));
 }
Esempio n. 5
0
 public static string Encrypt(string text, string password)
 {
     return(FishCryptoService.Encrypt(text, GetAesCryptoServiceProvider(password)));
 }
Esempio n. 6
0
 /// <summary>
 /// 使用TripleDES加密字节数组
 /// </summary>
 /// <param name="input"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public static byte[] Encrypt(byte[] input, string password)
 {
     return(FishCryptoService.Encrypt(input, GetTripleDESCryptoServiceProvider(password)));
 }