ssh-keygen
This is a pure python implementation of ed25519 key generation, with the support for seeded key generation so that you can create a pair of ssh keys from any string you like.
Security & Disclaimer
The author of this project is NOT a cryptography expert and provide ZERO guarantee on the security of this tool.
USE IT AT YOUR OWN RISK.
To the best of the author's knowledge, this tool has the following characteristics:
- It may suffer from timing attacks, so the key generation process must not be timed by a potential attacker.
- After generation, the key pair is cryptographically safe to use:
- The private key cannot be recovered from the public key.
- The seed cannot be recovered from the public key or private key or both.
Install
pip install ssh-keygen
Usage
Generate a private/public key pair:
# Interactive mode (launch a key generation wizard)
python -m ssh_keygen
# Command line mode
# -s <seed_string> Option 1: use seed string
# -f <file> Option 2: use seed file
# --random Option 3: use random 256-bit string
# -o <path> Path to save the private key file
# -n <N=1024> The number of hash iterations for seed string
# Larger N is safer but takes more time.
# -C <comment> Comment for the generate key
python -m ssh_keygen -s "this is a seed string" -o "/path/to/save/private_key"
python -m ssh_keygen -f "/path/to/seed_file" -o "/path/to/save/private_key"
Acknowledgements
This project refers to the following sources:
ed25519python implementation: https://github.com/pyca/ed25519/blob/main/ed25519.py- OpenSSH private key format: https://coolaj86.com/articles/the-openssh-private-key-format/
balloonpassword hashing: https://github.com/nachonavarro/balloon-hashing/blob/master/balloon.py
Metadata
Release files for ssh-keygen 1.0.4
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 | |
|---|---|---|---|---|
| ssh_keygen-1.0.4.tar.gz | 13.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ssh_keygen-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.6 kB
Release files / ssh_keygen-1.0.4.tar.gz
| Download URL | ssh_keygen-1.0.4.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efb23c8e01e6b4202272b1e90c7fde0c9ddd76245888b751321a43429b1db974
|
|
BLAKE2b-256 checksum How to use checksums |
8b700ea4eca96580ebcd05889686fd5ae04a7f3196e57768d5a67ef9f76aa7e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.7
|
Release files / ssh_keygen-1.0.4-py3-none-any.whl
| Download URL | ssh_keygen-1.0.4-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c09d73ab14537dc01cc518a9e92ffa67f1ed431620a6571dad5fef0f0dd150bb
|
|
BLAKE2b-256 checksum How to use checksums |
f4a4da56f0f52ce3ac77d2d4b26f0625771f553c7485f39ab009d1392cd0a0fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.7
|
Security for ssh-keygen 1.0.4
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.