Nostril is a command line utility that allows you to generate pubkey/private key, as well as even sign events.
To generate your own #nostr private key on linux or command line, run:
$ openssl rand -hex 32
this creates a 256 bit random number, and prints it in hex format, which is taken by nostr clients. You can take this as private key, and then enter into a client, which would show you the public key.
openssl rand -hex 32
and how to convert to nsec format from that please ?
How safe is this method of key generation? what is the likelihood that somebody else hasn't allready made a table of pre-generated key pairs?
Nostril is a command line utility that allows you to generate pubkey/private key, as well as even sign events.
To generate your own #nostr private key on linux or command line, run:
$ openssl rand -hex 32
this creates a 256 bit random number, and prints it in hex format, which is taken by nostr clients. You can take this as private key, and then enter into a client, which would show you the public key.
and how to convert to nsec format from that please ?
How safe is this method of key generation? what is the likelihood that somebody else hasn't allready made a table of pre-generated key pairs?
More replies
lol is it that simple?
More replies
You could use python-nostr https://github.com/jeffthibault/python-nostr
and generate a keypair in a little python script
from nostr.key import PrivateKey
private_key = PrivateKey()
public_key = private_key.public_key
print(private_key)
print(public_key)
More replies