Skip to main content

Unit Tests Style Checks

Password trainer script

This module contains a litle script to teach user a new random password by repeatedly typing it. The module is written in pure python and contains no external dependencies except for poetry build system and modules used for testing the code. The code should be very simple to review.

The idea is to use this tool with a password generator and some kind of password manager to ensure user does not remember the password but can write it without looking. It's not intended to replace password managers, it's intended to memorize password for primary logins and for the password manager master keys.

General procedure for me while using the tool:

  • generate new password for a system and store it to password manager
  • run this password trainer a couple of times with the password from the password manager, training my fingers to write the password mechanically
  • repeat it for a couple of days until sucecss rate is 100% and then change the actual password for the system

Generating random passwords

This tool does not generate random passwords. There are multiple secure and tested password generators and one is likely included in any password manager application.

Using the password trainer

The tool is installed as command line password-trainer. The tool reads password from stdin or file (for reading from password managers) or interactively. User is then requested to write the new password on screen until configured number of correct passwords has been entered. The tool shows a summary of success rate when it quits.

Parameters for the training phase can be specified as command line arguments. See password-trainer --help for more details.

Example commands

Run the command with default arguments. This will ask for the password to train on and require it to be written on screen 5 times correctly:

password-trainer

Show password from pass password store for 'Vault admin', pipe it to the password-trainer and request user to write it three times correctly:

pass Vault/Admin | head -1 | password-trainer --required=3 --file=-

Generate a random password with pwgen command, pipe it to the script and show the generated password to memorize and copy to a password manager:

pwgen -s 16 | password-trainer --required=2 --file=- --show-password

Installing

This module has minimal dependencies (PyYAML) and should install with pip on any recent python version.

The module has been tested with python 3.10 to 3.12.

Running unit tests and linters

All tests are run with tox.

Run unit tests and linters:

make

Run unit tests:

make test

Run linters:

make lint

Metadata

Release files for password-trainer 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for password-trainer 1.0.0
File Size Uploaded Provenance
password_trainer-1.0.0.tar.gz 6.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for password-trainer 1.0.0
File Interpreter ABI Platform
password_trainer-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / password_trainer-1.0.0.tar.gz

Download URL password_trainer-1.0.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cf8f62bc197141c6c7bd30bee8b0231eb4bc93d8a5844d8c01931258df50120c
BLAKE2b-256 checksum
How to use checksums
174d0af94e2e4b1cb91939c4bf0c29e0fa37116b68990214735cfbfa481ef7c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Darwin/23.6.0

Release files / password_trainer-1.0.0-py3-none-any.whl

Download URL password_trainer-1.0.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6668de5a1308f0488771f96375326de129ebb289aea10b44fc8295286b97a6c
BLAKE2b-256 checksum
How to use checksums
0e393938df47111d55647ffeadbeed74c8816e7b0d4f8fd5a8b9741ca3107153
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Darwin/23.6.0

Security for password-trainer 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page