Open dyyz1993 opened 6 years ago
@amyhickman there is no such thing as "how public-private key cryptography works". Both sides exist and have different purpose.
@debrice
there is no such thing as "how public-private key cryptography works".
What is that supposed to mean? There's no such thing as "how that thing works"?
wat?
https://en.wikipedia.org/wiki/Public-key_cryptography
Both sides exist and have different purpose.
I said what those purposes are.
It is indeed possible to "encrypt" with a private key and "decrypt" with a public key (even those are not the right terms, hence the quotes).
That's called signing/verification.
This library does not support it at the moment however, and there are a few related issues, as well as pull requests open to fix that.
I'm not sure if signing and verification is what is exactly being asked. It is possible in Java and Python AFAIK to encrypt and decrypt with any key. Even I'm struggling with same requirement where I have been asked to decrypt with public key. However i didnt find any libraries that are supporting this
Here is an example to explain why any company encrypt with a private key.
A is a company of setting up a APP to serve. people use accounts registering from A to login onto the APP and get a encrypted data named token
within some info of identification.
B is a company that supporting some mainly function of the APP.
C is the user accessing the APP.
The key point is that B must ensure that C is the really user of A. so B could:
That's how public-private key cryptography works. You always encrypt with the public key, and decrypt with the private key.