This C++ project offers a powerful, versatile and customizable password generator that creates strong and random passwords for me and you. The project now includes additional features such as password encryption and decryption, so that now even if someone open your passwords.txt file it will not be a problem as passwords will be encrypted and thus they make no sense this provides a comprehensive solution for managing secure passwords.
-
Length 8: Despite being a relatively short password, it was not found in any databases.
-
Length 12:
-
Length 16:
The generator.h
module is responsible for generating strong and random passwords. The algorithm ensures a balanced mix of lowercase letters, numbers, and symbols. The password length is customizable, with a recommended length of 12 or more for stronger passwords.
-
Initialization of Character Sets:
- Define arrays
alphabets
,nums
, andsymbols
representing lowercase letters, numbers, and symbols, respectively.
- Define arrays
-
Determine Parts of Password:
- Calculate three parts (
prt1
,prt2
,prt3
) based on the desired password length (n
). These parts represent the distribution of characters in the password.
- Calculate three parts (
-
Random Seed and Engine:
- Call makeRadom() from random.h function to generate random numbers by initializing a random seed using
random_device
and a Mersenne Twister engine (mt19937
).
- Call makeRadom() from random.h function to generate random numbers by initializing a random seed using
-
Generate Lowercase Letters:
- For the first part (
prt3
), randomly select lowercase letters from thealphabets
array. - If within the first third of this part, convert the letter to uppercase for added variety.
- For the first part (
-
Generate Numbers:
- For the second part (
prt2
), randomly select numbers from thenums
array.
- For the second part (
-
Generate Symbols:
- For the third part (
prt1
), randomly select symbols from thesymbols
array.
- For the third part (
-
Shuffle Characters:
- Use
shuffle
to rearrange the characters in the password, providing additional randomness.
- Use
-
Return Generated Password:
- The generated password is returned, ready to be displayed or copied.
-
Enter the desired length for the password when prompted. A length of 12 or more is recommended for strong passwords.
-
The generated password will be displayed, and you can copy and paste it as needed.
-
Or save it in
passwords.txt
file
The savePassword.h
module introduces the option to save generated passwords in encrypted form. When prompted, users can choose to save the password in a passwords.txt
file.
-
When prompted, choose to save the password in a
passwords.txt
file. -
Enter a tag/key to identify your password.
-
Your password, along with the provided tag, will be saved in the
passwords.txt
file.
The encrypt.h
module provides a Caesar cipher algorithm which is modified by me to encrypt each password differently. Even if password is same the encryption will be different each time it is run!
It enhances the security of stored passwords.
The decrypt.h
module allows users to decrypt passwords using the tag/key of the passwords you have stored. Users can enter the key associated with a saved password, and the module will decrypt and display the original password for you.
-
Choose the option to
decrypt a saved password
. -
Enter the key associated with the password when prompted.
-
The decrypted password will be displayed.
The random.h
module is used for generating random numbers. It was added to handle the warnings of object and engine being initialized multiple times.
The project includes a main.cpp
file that acts as the entry point. It presents users with options to generate passwords, save them securely, and decrypt saved passwords.
-
Compile the C++ code:
g++ main.cpp -o main
-
Run the compiled executable:
./main
-
For fellow Linux Users:
Just make run.sh executable and run:
chmod u+x run.sh ./run.sh
You can access different versions of RaNdDoom from tags options in the repository!
-
v-2.1 : Basic Random password generation
-
v-2.3 : Password saving feature is added - can save password in a file called
password.txt
-
v-3.1 :
Encryption
andDecryption
feature is added - now your passwords are encrypted before saving and then you can decrypt it when want to use them.
- RaNdDoom provides a comprehensive solution for password generation, secure storage, and retrieval.
- The encryption algorithm enhances the security of saved passwords.
- Customize the password length based on your security requirements.
- Make sure to have a C++ compiler installed on your system before running the code.
Feel free to explore, customize, and contribute to RaNdDoom based on your requirements. Your contributions, if valid, will be appreciated.
Enjoy! 😋