Skip to main content

Train user to enter new password

Project description

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

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

password_trainer-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

password_trainer-1.0.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file password_trainer-1.0.0.tar.gz.

File metadata

  • Download URL: password_trainer-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/23.6.0

File hashes

Hashes for password_trainer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cf8f62bc197141c6c7bd30bee8b0231eb4bc93d8a5844d8c01931258df50120c
MD5 a57e90ab76fa6e2e64038c0730a5083b
BLAKE2b-256 174d0af94e2e4b1cb91939c4bf0c29e0fa37116b68990214735cfbfa481ef7c6

See more details on using hashes here.

File details

Details for the file password_trainer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for password_trainer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6668de5a1308f0488771f96375326de129ebb289aea10b44fc8295286b97a6c
MD5 119e3288ec8eaab2f67150dfaea8e1f8
BLAKE2b-256 0e393938df47111d55647ffeadbeed74c8816e7b0d4f8fd5a8b9741ca3107153

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