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))); } }
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))); } }