Beispiel #1
0
        public string EncryptPass(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);
        }
Beispiel #2
0
        public string DecryptPass(String CipherText)
        {
            string plainText  = "";
            string cipherText = CipherText;         // encrypted text
            string passPhrase = "Pas5pr@se";        // can be any string
            string initVector = "@1B2c3D4e5F6g7H8"; // must be 16 bytes

            EncryptionClass ThisKey =
                new EncryptionClass(passPhrase, initVector);

            plainText = ThisKey.Decrypt(cipherText);

            return(plainText);
        }