Exemplo n.º 1
0
        public string Decrypt(string key, IDictionary <string, string> keyValues)
        {
            var hashedKey = _crypto.HashKey(key);
            var value     = keyValues[hashedKey];

            return(DecryptValue(value));
        }
Exemplo n.º 2
0
        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();
        }