-
Notifications
You must be signed in to change notification settings - Fork 448
Private/public key for decrypt/encrypt reversed #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
same mistake in:
regardless of algorithm, encrypting by a private key is useless as anybody has access to the public key, so anyone can easily decrypt and reads the original message (or session key) |
@guydingmike just realized the problem that u reported. Since you reportd it a long time ago and the problem is still there I created a PR for it. |
with reference to the last line!! |
@Sejal-G you're absolutely right. some libs even issue an error if a private key is used for encryption, although it may be possible to extract the public key from the private key efficiently (as in RSA) more ever, it may be mathematically impossible to decrypt a ciphered text by a public key as it does not contain all required bits for decryption. regardless of mathematical possibility, using a private key for encryption is semantically wrong and compromises the security as everyone can obtain the public key. ps. I'm not a guru either. |
I think there is a typo in the following two sections:
https://cryptobook.nakov.com/encryption-symmetric-and-asymmetric.html?q=#private-keys
Message encryption and signing is done by a private key.
Shouldn't this be "Message decryption and signing is done by a private key." ?
https://cryptobook.nakov.com/encryption-symmetric-and-asymmetric.html?q=#public-keys
Message decryption and signature verification is done by the public key.
And shouldn't this be "Message encryption and signature verification is done by the public key." ?
The text was updated successfully, but these errors were encountered: