Beispiel #1
0
        /// <summary>
        /// Reads an encrypted string value
        /// </summary>
        /// <param name="key"></param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public string ReadEncrypted(string key, string defaultValue)
        {
            string result = ReadNodeValue(key);

            if (result != null)
            {
                SimpleEncryption enc = new SimpleEncryption(_encryptionKey);
                return(enc.Decrypt(result));
            }
            return(defaultValue);
        }
Beispiel #2
0
        /// <summary>
        /// Writes an encrypted string value
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public void WriteEncrypted(string key, string value)
        {
            SimpleEncryption enc = new SimpleEncryption(_encryptionKey);

            WriteNodeValue(key, enc.Encrypt(value));
        }