Exemplo n.º 1
0
        private string Encrypt(string text)
        {
            var sym = new Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael);
            var key = new Encryption.Data("lnfn@n0f@b");

            var encryptedData = sym.Encrypt(new Encryption.Data(text), key);
            var encrypted     = encryptedData.ToBase64();

            return(encrypted);
        }
Exemplo n.º 2
0
        public static string Decrypt(string encrypted)
        {
            var sym = new Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael);
            var key = new Encryption.Data("lnfn@n0f@b");

            var encryptedData = new Encryption.Data
            {
                Base64 = encrypted
            };

            var decryptedData = sym.Decrypt(encryptedData, key);
            var result        = decryptedData.ToString();

            return(result);
        }