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.4.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssh_keygen-1.0.4-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file ssh_keygen-1.0.4.tar.gz.

File metadata

  • Download URL: ssh_keygen-1.0.4.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for ssh_keygen-1.0.4.tar.gz
Algorithm Hash digest
SHA256 efb23c8e01e6b4202272b1e90c7fde0c9ddd76245888b751321a43429b1db974
MD5 231203029a941a4db7b482a9cd75b3d1
BLAKE2b-256 8b700ea4eca96580ebcd05889686fd5ae04a7f3196e57768d5a67ef9f76aa7e3

See more details on using hashes here.

File details

Details for the file ssh_keygen-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: ssh_keygen-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.7

File hashes

Hashes for ssh_keygen-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c09d73ab14537dc01cc518a9e92ffa67f1ed431620a6571dad5fef0f0dd150bb
MD5 daf4eb1c1d68ab3b43ad3bbc467ba8a3
BLAKE2b-256 f4a4da56f0f52ce3ac77d2d4b26f0625771f553c7485f39ab009d1392cd0a0fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page