3
votes

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

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

2
Simple example for using your private key to encrypt something would be signing some document/text/hash thereof/...Sirko
@ArtjomB. I tried to explain more extensively here - not with too much success in upvotes though. Maybe too complex an explanation.Maarten Bodewes
@owlstead I originally searched for something like that, but haven't found it. Great self-post. It certainly is not too complex for Crypto.SE, but SO users might have problems with this.Artjom B.
@ArtjomB. I've restructured that answer, hopefully it's easier to read now.Maarten Bodewes

2 Answers

5
votes

As far as the term encryption is considered to be on the message itself, the answer is no because such an encryption is totally useless. Since the public key is supposed to be public everyone could use it to decrypt. Encrypting with the private key thus fails to provide confidentiality.

Signing on the other side, as others have already mentioned is the only use case for this. It does not apply the encryption to the actual payload (the message). It encrypts a cryptographic hash over the message (that can be reproduced from the same message only), using a different padding scheme. In this way you can be sure the actual party that has the private key signed the message.

2
votes

Asymmetric means you cannot use the same key for decryption that you used for encryption. Code signing is one scenario where you encrypt using the private key. Recipients of the code can then use their public key to verify if the code was unchanged.