Encrypting and Decrypting text files with OpenSSL
In the real world encryption has become very important to keep information safe from malicious actors. However, it can be an intimidating subject so here we will start with encrypting a simple text file with openSSL.
First, open up nano from the terminal and write up a little secret message, "Don't delete this hidden message!":
Here we have a text file named secret.txt that we are about to encrypt |
For this file name to do encryption is as follows:
~ % openssl aes-128-cbc -in secret.txt -out secret.txt.enc
Here is our encrypted text with an 8-byte signature: the ASCII characters "Salted__". |
Now to decrypt the file and create a readable version the command is almost identical you are now just defining -d before -in for:
~ % openssl aes-128-cbc -d in secret.txt.enc -out secret3.txt
Here is the decrypted message now in English again. |
Comments
Post a Comment