3
In my understanding, when you create a public-private key pair, first, you create a pair of complementary keys by using cryptographic software. Then you give one key the name public key, and give the other key the name private key. You keep the private key for yourself and give your public key to everyone else.
Then I was reading Mastering Bitcoin, I found this sentence:
Paper wallets are bitcoin private keys printed on paper. Often the paper wallet also includes the corresponding bitcoin address for convenience, but this is not necessary because it can be derived from the private key.
I don’t understand how it is possible to derive the corresponding bitcoin address(the hash of a public key) from the private key.
If the public key can really be derived from the private key, isn’t the opposite true? I mean, we can choose whichever is the private key when we generate them.
Be aware that in most RSA implementations e is NOT picked to be difficult to guess, furthermore most private key formats store more than (d,pq). So while you could theoretically build a RSA cryptosystem where public and private keys are interchangable it's not the done thing. – Peter Green – 2019-08-08T13:13:23.887
Then my question about the RSA is how it is almost impossible to guess the private key from the public key when it’s randomly chosen. Would you elaborate? – sflow – 2018-05-21T01:17:31.973
1@sflow it goes like this: pick two prime numbers p, q. pick another number e that is coprime with (p-1)(q-1). Calculate d. Then you have two keys (d, pq) and (e, pq). You label one of them private and the other public. Then you throw away p and q. If you have p, q and e you can recreate both keys. But from the one key you cant get to the other (unless you can find the prime factors of p*q) – Mike D – 2018-05-21T08:50:32.180