Skip to main content

ssh-keygen in pure python with seeded key generation support

Project description

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:

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

ssh_keygen-1.0.3.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distribution

ssh_keygen-1.0.3-py3-none-any.whl (14.5 kB view hashes)

Uploaded Python 3

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