Skip to content

John-Ao/python-ssh-keygen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

ssh-keygen in pure python with seeded key generation support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages