Exemplo n.º 1
0
        public void DecryptFileText()
        {
            cipherText = readFromFile(pathOfEncryptedFile);


            plainText = EncryptandDecrypt.Decrypt
                        (
                cipherText,
                passPhrase,
                saltValue,
                hashAlgorithm,
                passwordIterations,
                initVector,
                keySize
                        );

            Console.WriteLine(String.Format("Decrypted : {0}", plainText));
        }
Exemplo n.º 2
0
        public void EncryptFileText(string input)
        {
            plainText  = input;
            cipherText = EncryptandDecrypt.Encrypt
                         (
                plainText,
                passPhrase,
                saltValue,
                hashAlgorithm,
                passwordIterations,
                initVector,
                keySize
                         );
            Console.WriteLine(String.Format("Plaintext : {0}", plainText));

            Console.WriteLine(String.Format("Encrypted : {0}", cipherText));
            //Write the encrypted text to the file
            writeToFile(cipherText);
        }