Public key encryption and private encryption

I have implemented asymmetric encryption in my project using a "public key" to "encrypt" the message and a "private key" to "decrypt" the message.

Do we use the "private key" to "encrypt" the message and the "public key" to "decrypt". If yes, can anyone give me an example of a use case and this cryptography is also called "asymmetric encryption"

+3


source to share


2 answers


Since the term encryption is considered in the message itself, the answer is no , because such encryption is completely useless. Since the public key must be publicly available, anyone can use it to decrypt. Thus, private key encryption does not provide confidentiality.



Signing on the other hand, as mentioned, is the only precedent for this. It does not apply encryption to the actual payload (message). It encrypts a cryptographic hash over a message (which can only be reproduced from the same message) using a different padding scheme. This way, you can be sure that the actual party who has the private key signed the message.

+5


source


Asymmetric means that you cannot use the same decryption key that you used for encryption. Code signing is one scenario where you encrypt with a private key. Recipients of the code can then use their public key to check if the code has changed.



+2


source







All Articles