OpenSSL Encryption Algorithm In Linux

Piyush KabraPiyush Kabra
2 min read

OpenSSL is a robust cryptographic library that provides a wide range of algorithms for secure data encryption, hashing, and digital certificates.

It supports various hash functions, including SHA-256, SHA-3, and MD5, which are commonly used to generate message digests for data integrity and authentication.

OpenSSL's versatility allows developers to implement secure communications and data protection in applications, while its command-line tools make it easy to test and use cryptographic algorithms.

Whether for encryption, hashing, or creating digital signatures, OpenSSL serves as a critical tool in modern cybersecurity.

Let’s Understand this through an Example on Linux Command Line :-

As i have Mentioned previously, how is this possible with cat command to write something inside a file, if you have not seen it, then go checkout here.

Now Lets Decode The Line :-

openssl enc -in plain.txt -aes256 -e -out secure.txt

OpenSSL :- Asking Openssl to perform encryption operation

enc :- Want to encrypt this file

-in plain.txt :- input file named plain.txt

-aes256 :- The algorithm i want to use for encryption of 256 bits Key size

-e :- this file is to be encrypted (shorthand of encryption)

-out secure.txt :- Create Output file named Secure.txt

Removing plain.txt file as it is not secure to put a password file in the system.

Removing plain.txt file as it is not secure to put a password file in the system.

Here -d means Decrypting the file from aes256 algorithm and for that it will ask password that we have given at the time of creation of this algorithm.

So we have seen how OpenSSL algorithm secure files and make them encrypted.

0
Subscribe to my newsletter

Read articles from Piyush Kabra directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Piyush Kabra
Piyush Kabra