We all know about SSL-The mechanism used to make Web transaction secure. And many of us are also aware of OpenSSL-the open source way to implement SSL. Websites using SSL have URLs beginning with https instead of http and their default port is 443. So far what I have said is already known to you. But what I’ll discuss next may be something new to you.
So guys now we’ll see a new way to use OpenSSL. Here we will not decrypt our communication with a Web Server but we’ll simply encrypt normal files using OpenSSL. Got interested? Ya I know you are keen to how we can do it. So let the action begin-
- Create a file which we’ll decrypt by using touch command.
touch a.txt
- Now we will encrypt this file. The command is a bit complicated to do so.
openssl enc -aes-256-cbc -salt -in a.txt – out a.out
- Now we have an encrypted file named a.out. Now you can’t view its content by issuing cat a.out command. To decrypt this file issue the following command-
openssl enc -d -aes-256-cbc -in a.out
This will show the contents of the file. Happy encryption.