As the apg approach generates six password instances at a single command execution, makepasswd can generate more password phrase options and also specify the character length of these password phrases. Its command string accommodates the use of an integer argument to specify the number of password phrase outcomes you wish to generate. Using makepasswd is simple and even more flexible than the apg approach. $ sudo apt install makepasswd $ sudo pacman -S makepasswd $ sudo yum install makepasswdĪs you have noticed, you will also need to be a Sudoer user to be granted the execution permissions of installing this package. For the Debian-based, Arch-based, and RPM-based Linux systems, respectively, the makepasswd installation command is straightforward. You first need to install it to use this utility since it is not inbuilt like most of the approaches we have covered. It is a unique approach to generating many passwords at once without the need for running a single command over and over again to get the desired number of password phrases. You can choose to go with either of the generated phrases, or you can use them all in your various password requirements. $ apg -a 1Īs you can see, the output has unraveled six unique options. Time to be more practical with this apg password-generation approach. The varying output options will have a length of 8-10 unique random characters. Generating these random password phrase options is as easy as running the command string apg -a 1. From these options, you will select a phrase that best works for you as a password. It takes a random input and generates a variance of password phrase options. Using this utility is easy, and its approach is different from the other password-generation mechanisms we have handled so far. This tool is prepackaged with the OS or installed during the OS installation on an Ubuntu Linux system. APG is another effective tool for automating the generation of unique password phrases on a Linux environment. Using -iter or -pbkdf2 would be echo "U2FsdGVkX19MdDInWumh31tKJoqR5HQwSXlxj3NiRC8=" | openssl enc -aes-256-cbc -a -d -salt -pass pass:my_password *** WARNING : deprecated key derivation used. # encrypt string with algorithm aes-256-cbc with randomly generated salt and input passwordĮcho "my_content" | openssl enc -aes-256-cbc -a -salt -pass pass:my_passwordĮcho "U2FsdGVkX19MdDInWumh31tKJoqR5HQwSXlxj3NiRC8=" | openssl enc -aes-256-cbc -a -d -salt -pass pass:my_password echo "my_content" | openssl enc -pbkdf2 -a -salt -pass echo "bXlfY29udGVudAo=" | openssl enc -pbkdf2 -a -d -salt -pass echo "my_content" | openssl enc -aes-256-cbc -a -salt -pass pass:my_password # note: just add parameter -d to above openssl parametersĮcho "bXlfY29udGVudAo=" | openssl enc -pbkdf2 -a -d -salt -pass pass:my_password We can encrypt sensitive content, say “my_content” with openssl with different encryption algorithms in the below manner: # encrypt string with algorithm pbkdf2 with randomly generated salt and input passwordĮcho "my_content" | openssl enc -pbkdf2 -a -salt -pass pass:my_password Lets say we have a file with some sensitive content. Openssl passwd -crypt -salt my_salt my_password # generates hashed password with crypt algorithm + salt With openssl, we can generated hashed-passwords for supplied password as input: # generates hashed password with crypt algorithm # generates 12-character password and encrypted md5 password Makepasswd -chars=12 -crypt -cryptsalt=20 # generates 12-character password and encrypted password with crypt algorithm + salt We can generated encrypted passwords with utilities like makepasswd: # generates 12-character password and encrypted password with crypt algorithm ![]() ![]() # generates specified 12-character passwords, say 5 # generates multiple 12-character passwords ![]() We can utilities like mkpasswd or pwgen to generate random passwords if needed: # generates multiple 8-character passwords We can use the same to encrypt and decrypt passwords in Linux to protect sensitive data. OpenSSL is one of the utilities available with all major Linux distributions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |