Strong Passwords Generator made with python.
Project description
f-passwords-generator
Strong Passwords Generator made with python.
Attributes
text
(can be modified, have getter and setter): The plain text to be ciphered.key
(can be modified, have getter and setter): The key phrase to be used in the ciphering operation on algorithms like playfair (default is 'password').shift
(can be modified, have getter and setter): The number to be used as shift on algorithms like caesar (default is 3).algorithm
(can be modified, have getter and setter): The algorithm to be used for ciphering operation (default is playfair).characters_replacements
(cannot be modified, have only getter): Custom dictionary you can use to change characters after ciphering (default is empty).matrix
(cannot be modified, have only getter): The matrix used in the ciphering operation.
Methods
replace_character(char: str, replacement: str)
: used to add an item tocharacters_replacements
.reset_character(char: str)
: remove the character fromcharacters_replacements
if exists.generate_password()
: generate a password from thetext
usingkey
orshift
according to the usedalgorithm
andcharacters_replacements
.
How to use
from passwords_generator import PasswordGenerator
pass_gen = PasswordGenerator(text=None, key="password", shift=3, algorithm="playfair")
pass_gen.text = "demo text"
pass_gen.key = "demo key" # will be used on algorithms like playfair (default is 'password')
pass_gen.shift = 3 # will be used on algorithms like caesar (default is 3)
pass_gen.algorithm = 'playfair' # specify the algorithm to use (default is playfair)
pass_gen.replace_character(char="", replacement="")
pass_gen.reset_character(char="")
password = pass_gen.generate_password()
Examples
Example 1
from passwords_generator import PasswordGenerator
pass_gen = PasswordGenerator("demo code", "demo key")
password = pass_gen.generate_password()
Example 2
from passwords_generator import PasswordGenerator
pass_gen = PasswordGenerator()
pass_gen.text = "demo text"
pass_gen.key = "demo key"
password = pass_gen.generate_password()
Example 3
from passwords_generator import PasswordGenerator
pass_gen = PasswordGenerator("demo text", shift=3, algorithm="caesar")
password = pass_gen.generate_password()
Example 4
from passwords_generator import PasswordGenerator
pass_gen = PasswordGenerator()
pass_gen.text = "demo text"
pass_gen.shift = 3
pass_gen.algorithm = 'caesar'
password = pass_gen.generate_password()
Notice
The valid cipher algorithms are only those who has been implemented on cipherspy
package.
- caesar
- playfair (default one)
License
The code in this repository is licensed under the MIT License.
You can find the full text of the license in the LICENSE file. For more information, please visit the repository on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file f-passwords-generator-2.0.1.tar.gz
.
File metadata
- Download URL: f-passwords-generator-2.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c518d1302b33d39c6fa5b91356f41fed1f10ebcf8b690f28b0dcf4cdf4cebf1 |
|
MD5 | a9e03c68d317187a1c6b96727df6b8ec |
|
BLAKE2b-256 | da46c6b56517c6fac356382857dea75377055b6f7d275eee384af70c4874d518 |
File details
Details for the file f_passwords_generator-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: f_passwords_generator-2.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 992f27bee7609b5d09563dc3b83eebce51ddc0869551404903b3a9c93698cb22 |
|
MD5 | 90e5b4937ea8c797d0c71a3ebad2efa5 |
|
BLAKE2b-256 | 94210a531e6ffcdb9679da128a58b556c5f6ac4ae0a4f8a4804c9dd63a4c1b28 |