private static AesCryptoServiceProvider GetAesCryptoServiceProvider(string password) { AesCryptoServiceProvider sa = new AesCryptoServiceProvider(); FishCryptoService.SetKeyIV(sa, password); return(sa); }
private static TripleDESCryptoServiceProvider GetTripleDESCryptoServiceProvider(string password) { TripleDESCryptoServiceProvider sa = new TripleDESCryptoServiceProvider(); FishCryptoService.SetKeyIV(sa, password); return(sa); }
public static byte[] Decrypt(byte[] input, string password) { return(FishCryptoService.Decrypt(input, GetAesCryptoServiceProvider(password))); }
public static string Decrypt(string base64, string password) { return(FishCryptoService.Decrypt(base64, GetAesCryptoServiceProvider(password))); }
public static string Encrypt(string text, string password) { return(FishCryptoService.Encrypt(text, GetAesCryptoServiceProvider(password))); }
/// <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))); }