passhash
Generate password hashes based on various standards. Most UNIX crypt standards are supported, along with a selection of Microsoft, Cisco, and LDAP-based standards.
Installation
pipx install passhash
Usage
By default, passhash will prompt for a password and generate a UNIX-style SHA2-512 hash:
passhash
Password:
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Method ┃ Hash ┃ Time ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ sha512_crypt │ $6$rounds=656000$ohgWV4S9N2wPmYsN$7ZR6zmTAy5ePkrjnEnOUyOuF3pRE4TLvucwSs4AewUcOC59YawNkXap │ 0.559s │
│ │ AkqqUNJfcHuo0es6mGRQJO36EGz3aY/ │ │
└──────────────┴───────────────────────────────────────────────────────────────────────────────────────────┴────────┘
A random password can be generated instead with the --generate option:
passhash --generate
Password: am3YVAbcMxK
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Method ┃ Hash ┃ Time ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ sha512_crypt │ $6$rounds=656000$M4iIIAbmfVYVytIF$/MrspoGH6PMDq7IeS3RFPFhedUdGoYIddq7KAuYXAH4pYRI1Ge.3ykb │ 0.580s │
│ │ yO2PrTleh4kna.t22CnjefckO5XlyJ1 │ │
└──────────────┴───────────────────────────────────────────────────────────────────────────────────────────┴────────┘
Additional parameters such as the salt can be specified, see passhash --help for the full list:
passhash --generate --unix-md5 --salt secret
Password: RvkrpxCR3uv
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Method ┃ Hash ┃ Time ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ md5_crypt │ $1$secret$SmI5vW6El8fsZHapctHAl. │ 0.008s │
└───────────┴──────────────────────────────────┴────────┘
If a selected hash algorithm requires a username it will prompt for it:
passhash --generate --windows-msdcc2
Username: jsmith
Password: baQpwMueTKm
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Method ┃ Hash ┃ Time ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ msdcc2 │ 254bbbbd2da9a0bd48681f9a67e3ca44 │ 0.003s │
└────────┴──────────────────────────────────┴────────┘
One or more algorithms can be specified as runtime, see passhash --help for the full list:
passhash --generate --unix-md5 --ldap-md5
Password: aHMHCAXJMmP
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Method ┃ Hash ┃ Time ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ ldap_md5 │ {MD5}8o3o/NROgZ6U55wxjuLoDw== │ 0.000s │
│ md5_crypt │ $1$lUpHRYmh$yvlUtIwPk5p5kXoW6kJpu/ │ 0.001s │
└───────────┴────────────────────────────────────┴────────┘
Use --all to generate all supported hash algorithms:
passhash --generate --all
Development Environment
git clone https://github.com/ReK42/passhash.git
cd passhash
pre-commit install
pip install -e .[tests]
Metadata
Release files for passhash 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| passhash-1.0.1.tar.gz | 124.0 kB | Without provenance | Details for passhash-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| passhash-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for passhash-1.0.1-py3-none-any.whl |
Total release size: 155.9 kB
Release files / passhash-1.0.1.tar.gz
| Download URL | passhash-1.0.1.tar.gz |
|---|---|
| Size | 124.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
915d0aad0f0512db92a2fefe7151831fc6e0ecec27b593481a4a5b5f5e283ecb
|
|
BLAKE2b-256 checksum How to use checksums |
f571efd3292a338587a14e2ea0d3f5330f35f6bcf2aa98767aa03f31c4e649be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / passhash-1.0.1-py3-none-any.whl
| Download URL | passhash-1.0.1-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72b139e53244e86480a84a62ee87d4ff3f84bdfb6110415f7f414d8090b1ada4
|
|
BLAKE2b-256 checksum How to use checksums |
3325af4e2669e978cd7268cace7576eb20c02ba165f538415f41e7179997a8fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for passhash 1.0.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.