Exemplo n.º 1
0
        public static string EncryptPass(this string passwordPlainText)
        {
            string          plainText  = passwordPlainText.Trim();
            string          cipherText = "";                 // encrypted text
            string          passPhrase = "Pas5pr@se";        // can be any string
            string          initVector = "@1B2c3D4e5F6g7H8"; // must be 16 bytes
            EncryptionClass thisKey    = new EncryptionClass(passPhrase, initVector);

            cipherText = thisKey.Encrypt(plainText);
            return(cipherText);
        }
Exemplo n.º 2
0
        public static string DecryptPass(this string cipherText)
        {
            var plainText = "";
            // var cipherText = CipherText;                 // encrypted text
            var passPhrase = "Pas5pr@se";        // can be any string
            var initVector = "@1B2c3D4e5F6g7H8"; // must be 16 bytes

            EncryptionClass thisKey = new EncryptionClass(passPhrase, initVector);

            plainText = thisKey.Decrypt(cipherText);

            return(plainText);
        }