0
$\begingroup$

I try to understand the private and the public key concept, and need some validation about my statements:

  1. If I encrypt a message with public key, I can only decrypt with private key.
  2. If I encrypt a message with private key, I can only decrypt with public key.
  3. I can generate public key (derived key) from private key(base key).
  4. I can not generate private key from public key.
  5. Private key name comes how I handle the key: I keep it in secret, so I call it private key.
  6. Public key name comes how handle the key: I publish it, anybody can use it, so this is the public key.
  7. If I publish the base key, I can call it public key
  8. If I keep in secret the derived key, I can call it private key.
$\endgroup$
  • 3
    $\begingroup$ "If I encrypt a message with private key, I can only decrypt with public key." You do not encrypt using a private key, ever. $\endgroup$ – Maeher Jan 25 at 14:32
  • $\begingroup$ May the example is not the best, but based on this article, highlighted the Digital signature part, I do encrypt a message with private key: ogcio.gov.hk/en/our_work/regulation/eto/digital_cert/… $\endgroup$ – HowDoYouTellForAChild Jan 25 at 14:43
  • $\begingroup$ Ad "publish key": In which context have you seen this? Is it in any way related to this? $\endgroup$ – dkaeae Jan 25 at 14:44
  • 1
    $\begingroup$ @HowToTellForAChild That is sadly a relatively common misconception. It's still completely and utterly wrong. A signature scheme that would work in that way would be absolutely insecure and/or non-functional. $\endgroup$ – Maeher Jan 25 at 14:47
  • $\begingroup$ @dkaeae not, I was think only to public key, if I mentioned publish key. It was just a mistyping. $\endgroup$ – HowDoYouTellForAChild Jan 25 at 14:52
0
$\begingroup$
  1. Yes that's it!
  2. Never encrypt with your private key for secrecy! But you got the concept, your public key can reverse an operation done with your private key. That's basically how some signature works (take RSA-PSS for instance); but not exactly, you need to take extra care to make it really secure. Keep in mind that signature and encryption are two different things. You can encrypt a signature with your private key in order to show data integrity.
  3. Yes that's how public key are generated, public and private key are always linked in some way (the process to create the public key is not always the same).
  4. Yes, if you could do it, your encryption scheme would be broken.
  5. Yes, it's a common practice to name it that way.
  6. Same answer.
  7. You refereed to your private key as the base key, so I will assume that you were talking about it in this point. You should never publish your private key. If you do so, both keys become useless.
  8. You refereed to your public key as the derived key, so I will assume that you were talking about it in this point. Keeping your public key for yourself is useless, but even if you do so, don't call it "private", it's confusing. Your public key will always be called public, whether or not your publishing it.

I tried to address all of your point clearly, fell free to ask for clarification or details in comments

$\endgroup$
  • $\begingroup$ Never encrypt with your private key for the purpose of secrecy. But do encrypt a signature with your private key for the purpose of demonstrating data integrity. $\endgroup$ – vrtjason Jan 25 at 15:00
  • 1
    $\begingroup$ Forgot to mention that point, I modified the answer accordingly, thanks $\endgroup$ – Faulst Jan 25 at 15:05
  • 3
    $\begingroup$ Signatures being "encrypt with the private key and decrypt with the public key" is completely wrong: Besides the fact that signing is not encryption, how does this apply to most signature schemes, such as hash-based signatures, Schnorr signatures, etc. In many signature schemes, encrypting with either key is simply not possible. Please help us dispel this widely repeated but wrong concept, rather than reinforcing it. $\endgroup$ – Ella Rose Jan 25 at 15:53
  • $\begingroup$ @EllaRose That wasn't my point, sorry if I didn't explained well enough, I modified my answer to clarify this point $\endgroup$ – Faulst Jan 25 at 16:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.