Hello, In this article we are going to explain how to generate, encrypt & decrypt random passwords in Linux. We added some most powerful Linux commands for generating random passwords. By using these commands you can able to encrypt and decrypt the random passwords easily. These methods will help you to generate a strong password.
Common Facts For Generating Random Passwords:
- Password length must be in more than 14 characters
- It includes Small letter & Capital letters.
- It includes numeric characters.
- It includes some random symbols and characters.
Security is one of the most important matter nowadays. Hackers are getting more stronger than previous and so we need to take proper precautionary. It is very easy to generate the most powerful password using the following commands. Linux is very good at this and so these passwords are generated by using the machine based language generator.
Generate Random Password using with OpenSSL:
The below codes will generate OpenSSL using rand function and it will generate the random passwords.
Generate Random Strong password using gpg:
You can use the gpg tool to generate random passwords otherwise you can use the following commands to generate random strong passwords.
Generate Random Password using Gen Password:
When you need to generate a random password then we suggest you use the “genpasswd” command and the random password will be generated in the terminal.
Generate Password using PWGEN:
For using these commands, you just need to install APT or Yum in your pc. The simple command used for generating passwords is “pwgen“.
The above command will generate a 50 random character password. This command will generate a random password.
Generate Password using MakePassword:
This is similar to “rand” and it generates a random password with random characters.
This command will generate a random password contains 100 random characters.
How to encrypt the password in Linux:
The Linux has the inbuilt password encrypted. It will be very easy to generate an encrypted password. For this, you just need to install “Salt“. Salt is a random data which serves as an additional input to one-way function in order to protect password against the dictionary attack.
The below command will generate a random encrypted password.
Now let us define the salt. It will output the same result every-time. Note you can input anything of your choice as salt.
Encrypt a strong password using aes-256-cbc:
Here we explained this command using the aes-256-cbc for the following string “Tecrobust is the best” using a password “Tecrobust”
Here the echoed input has been encrypted using Encoding with Cipher (enc), which uses aes-256-cbc encryption algorithm finally with salt it is encrypted using the password (tecrobust).
Decrypt a Random Password using Linux:
Decrypt the above string using openssl command using the -aes-256-cbc decryption. The encrypted password has been generated using the above Linux command.
Okay, friends. You reached the conclusion here. The above methods are the most commonly using methods to generate a random password using Linux commands. If you have any queries related to this and then feel free to comment on us.
The best methods to generate Random Strong password using Linux commands are posted here.