File encryption using OpenSSL

What is OpenSSL?

What is AES?

  • The length of a 128-bit key is 3.4 x 1038 bits
  • The length of a 192-bit key is 6.2 x 1057 bits
  • The length of a 256-bit key is 1.1 x 1077 bits

3DES or AES symmetric key encryption on a text file

  1. Open the terminal
  2. Encrypt the relevant file using the following command
openssl enc –aes-256-cbc –in sslabs1.txt -out ensslabs1.txt

RSA asymmetric key encryption on a text file

  1. Open the terminal
  2. For Asymmetric encryption firstly we must generate the private key and extract the public key.
openssl genrsa -aes256 -out private.key 2025openssl rsa -in private.key -pubout -out public.key
openssl rsautl -encrypt -pubin -inkey public.key -in sslabs1.txt –out en_rsa_sslabs1.txt
openssl rsautl -decrypt -inkey private.key -in en_rsa_sslabs1.txt –out decrypted_sslabs1.txt

--

--

--

Lecturer at University of Indigenous Medicine| News Anchor — SLRC | Tech Enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How Do You Clean and Disinfect a Memory FoamMattress? https://t.co/CZmm1zoOXX

SANS Holiday Hack Challenge 2020: Objective 9— ARP Shenanigans

📢📍The first epoch of the APYS/DSPL LP program passed halfway!

3 Steps To Overcoming the Shortage in Security Talent (Hint: You Already Have What You Need)

{UPDATE} Ocean Survival 2 Premium Hack Free Resources Generator

Tracking Advanced Persistent Threats (APTs) via Shared Code

The CISO’s Observable Universe

I — Risk Management

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Naduni Ranasinghe

Naduni Ranasinghe

Lecturer at University of Indigenous Medicine| News Anchor — SLRC | Tech Enthusiast

More from Medium

How to Install Google Chrome 98 in Ubuntu / Rocky Linux & Fedora

Multi Device Automation for Bluetooth operations using Micro Controllers

DHCP Server and Basic Configurations

Docker updates terms of service for Docker Desktop!