Skip to main content

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 to characters_replacements.
  • reset_character(char: str): remove the character from characters_replacements if exists.
  • generate_password(): generate a password from the text using key or shift according to the used algorithm and characters_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

f-passwords-generator-2.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

f_passwords_generator-2.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file f-passwords-generator-2.0.0.tar.gz.

File metadata

  • Download URL: f-passwords-generator-2.0.0.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

Hashes for f-passwords-generator-2.0.0.tar.gz
Algorithm Hash digest
SHA256 09676f96c8a589fedf42610167398def2e36cc4334b38987b669b8601876b663
MD5 90157007d80153c8c1348d3e82770149
BLAKE2b-256 731a3f614337aa7d4245d05df44243bddc1abb9d6fa9570694eb3c7c6f143cf6

See more details on using hashes here.

File details

Details for the file f_passwords_generator-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for f_passwords_generator-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7fdd01480d4f9fed50ab740db01bcabcc7dfba792488f20bb51ae143c113a2d
MD5 3481ab048fec39b7ecbe99ff8495bf86
BLAKE2b-256 e259a38bee7b2a9a3aef7d8671defe384af15b68a81095a316f6c6e45b83d968

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page