示例#1
0
 public static string Decrypt(string ciphertext, string key)
 {
     using (SecretEncryptor dataEncryptor = new SecretEncryptor(new AdvancedSecureRandom(new Blake2bDigest(512), RandomString.Secure.Blake2.GetString(key, 64))))
     {
         return(dataEncryptor.Decrypt(ciphertext, RandomString.Secure.SHA3.GetString(key, 64)));
     }
 }
示例#2
0
 private static string Encrypt(string secret, string key)
 {
     using (SecretEncryptor dataEncryptor = new SecretEncryptor(new AdvancedSecureRandom(new Blake2bDigest(512), RandomString.Secure.Blake2.GetString(key, 64))))
     {
         return(dataEncryptor.Encrypt(secret, RandomString.Secure.SHA3.GetString(key, 64)));
     }
 }