public string Decrypt(string key, IDictionary <string, string> keyValues) { var hashedKey = _crypto.HashKey(key); var value = keyValues[hashedKey]; return(DecryptValue(value)); }
public string Decrypt(string key, IDictionary <string, string> keyValues) { foreach (var lookupKey in new[] { key, _crypto.HashKey(key) }) { if (keyValues.ContainsKey(lookupKey)) { var value = keyValues[lookupKey]; return(IsEncryptedValue(value) ? DecryptValue(value) : value); } } throw new KeyNotFoundException(); }