Question about cryptography and public/private keys

Question about cryptography and public/private keys

Secure Home | Search | About
 Computer Software Security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content add this group's latest topics to your Google content
Subject Author Date
Question about cryptography and public/private keys Erich Kohl 11-02-2006
Posted by Erich Kohl on November 2, 2006, 1:25 am
If you were  Registered and logged in, you could reply and use other advanced thread options
Hello all,

If this isn't the correct forum, I apologize in advance. I wasn't
sure where else to post this.

I have a question about cryptography, public and private keys, and
digital certificates. I've been trying to understand the whole
concept, and I'm getting closer to that goal, but I am still perplexed
by one aspect of it.

My understanding is that public keys and private keys are inverse
functions of one another; that is, only a person's public key can
"undo" (decrypt) a message that was encrypted by their original
private key.

Okay, so the private key is kept secret. But the thing is, since the
keys are related to each other in the sense that they are
mathematically "inverse functions" of one another, can't somebody
figure out what a person's or institutions's private key is simply by
reverse engineering the public key? By figuring out what the inverse
of the public key is?

Is it just that it would take such an incredibly long time to do, that
it would be a pointless waste of effort? Or is it the purpose of a
digital certificate to prevent that from happening? Is there a
mathematical reason?

I appreciate any explanation that can be given.

Posted by Todd H. on November 2, 2006, 2:01 am
If you were  Registered and logged in, you could reply and use other advanced thread options

> Hello all,
>
> If this isn't the correct forum, I apologize in advance. I wasn't
> sure where else to post this.
>
> I have a question about cryptography, public and private keys, and
> digital certificates. I've been trying to understand the whole
> concept, and I'm getting closer to that goal, but I am still perplexed
> by one aspect of it.
>
> My understanding is that public keys and private keys are inverse
> functions of one another;

As a technical nit, they are not "inverse functions" as defined in
mathematics or cryptography, but lookin gbeyond that semantic issue...

> that is, only a person's public key can
> "undo" (decrypt) a message that was encrypted by their original
> private key.

Correct. In the parlance of cryptography, yes, the public key is used
to recover the plain text message from the ciphertext.

> Okay, so the private key is kept secret. But the thing is, since the
> keys are related to each other in the sense that they are
> mathematically "inverse functions" of one another, can't somebody
> figure out what a person's or institutions's private key is simply by
> reverse engineering the public key? By figuring out what the inverse
> of the public key is?
> Is it just that it would take such an incredibly long time to do,
> that it would be a pointless waste of effort?

I think the concept left out of the model you have right now is the
notion of a one-way function -- a function easy to compute in one
direction but essentially infeasible to compute in the reverse
direction... unless there's a trap door in the algorithm or
implementation.

> Or is it the purpose of a digital certificate to prevent that from
> happening? Is there a mathematical reason?

Certificates, while also based on one-way functions, are sort of
unrelated to the issue of reversing keys.

> I appreciate any explanation that can be given.

I'm sure there are better explanations out there from someone formally
trained in cryptography but hopefully this gives some sort of start.

There is a sci.crypt group I think that specializes in this stuff that
might be worth lurking in for a while to see if they ahve a FAQ that
covers it or something.

Best Regards,
--
Todd H.
http://www.toddh.net/

Posted by Matthew Fanto on November 2, 2006, 10:32 am
If you were  Registered and logged in, you could reply and use other advanced thread options

Erich Kohl wrote:
> If this isn't the correct forum, I apologize in advance. I wasn't
> sure where else to post this.

A good place is the sci.crypt forum, but this works too.

> I have a question about cryptography, public and private keys, and
> digital certificates. I've been trying to understand the whole
> concept, and I'm getting closer to that goal, but I am still perplexed
> by one aspect of it.

No problem, the ideas of public key cryptography isn't the easiest
thing, and when you throw digital signing in, it becomes even harder to
understand. Once you learn a few basic points, then whole thing then
starts to make sense.

>
> My understanding is that public keys and private keys are inverse
> functions of one another; that is, only a person's public key can
> "undo" (decrypt) a message that was encrypted by their original
> private key.

As pointed out, they are inverse in that one undoes the other. But Todd
H. is incorrect in saying that the public key recovers the plaintext
from the ciphertext. It's actually the opposite. The plaintext is
encrypted with the public key, and the private key is used to recover
the plaintext from the ciphertext.

Think about it this way, if I encrypted a secret message with my
private key, and the public key was used to decrypt it, anyone would be
able to decrypt my message, since everyone has my public key.

This is actually a useful property though, and it's how we do digital
signatures. But you should distinguish between encryption and signing.
The operations are reverse of eachother.



> Okay, so the private key is kept secret. But the thing is, since the
> keys are related to each other in the sense that they are
> mathematically "inverse functions" of one another, can't somebody
> figure out what a person's or institutions's private key is simply by
> reverse engineering the public key? By figuring out what the inverse
> of the public key is?
> Is it just that it would take such an incredibly long time to do, that
> it would be a pointless waste of effort? Or is it the purpose of a
> digital certificate to prevent that from happening? Is there a
> mathematical reason?


Yes, there we is a well defined relationship between the two. In the
case of RSA, you take two really big prime numbers and multiply them
together. The primes are your private key (technically the primes are
used to find the private key, but it suffices in this discussion to say
they are the private key), and the product of those primes are your
public key.

So, generate two huge primes, p and q. Your public key is p*q. The
reason this is secure is because if I give you p*q (public), it's very
very very difficult to find what p and q is. You need p and q for the
private key. Thats why it can't be reversed. It is tied to the
difficulty of factoring.


> I appreciate any explanation that can be given.

Just to clarify a point, here is how encryption and signing works:

If you want to send me an encrypted message, you would use my public
key and encrypt the message. My private key decrypts it.

If you want to sign a message, you "encrypt" it with your private key.
The public key is used to "decrypt" this message. Anyone who has your
public key can "decrypt" it and verify the signature. The reason this
works is because only you have access to your private key, so only you
can "encrypt" with the private key.

-Matt


Posted by Todd H. on November 2, 2006, 10:57 am
If you were  Registered and logged in, you could reply and use other advanced thread options

> As pointed out, they are inverse in that one undoes the other. But Todd
> H. is incorrect in saying that the public key recovers the plaintext
> from the ciphertext. It's actually the opposite. The plaintext is
> encrypted with the public key, and the private key is used to recover
> the plaintext from the ciphertext.

Doh--yer right. This is where signing and encrypting differ.
Matthew thanks for correcting that gaff.


--
Todd H.
http://www.toddh.net/

Posted by Erich Kohl on November 2, 2006, 6:32 pm
If you were  Registered and logged in, you could reply and use other advanced thread options
wrote:

>
>Erich Kohl wrote:
>>
>> My understanding is that public keys and private keys are inverse
>> functions of one another; that is, only a person's public key can
>> "undo" (decrypt) a message that was encrypted by their original
>> private key.
>
>As pointed out, they are inverse in that one undoes the other. But Todd
>H. is incorrect in saying that the public key recovers the plaintext
>from the ciphertext. It's actually the opposite. The plaintext is
>encrypted with the public key, and the private key is used to recover
>the plaintext from the ciphertext.
>
>Think about it this way, if I encrypted a secret message with my
>private key, and the public key was used to decrypt it, anyone would be
>able to decrypt my message, since everyone has my public key.
>

Makes sense.

>This is actually a useful property though, and it's how we do digital
>signatures. But you should distinguish between encryption and signing.
>The operations are reverse of eachother.
>
>> Okay, so the private key is kept secret. But the thing is, since the
>> keys are related to each other in the sense that they are
>> mathematically "inverse functions" of one another, can't somebody
>> figure out what a person's or institutions's private key is simply by
>> reverse engineering the public key? By figuring out what the inverse
>> of the public key is?
>> Is it just that it would take such an incredibly long time to do, that
>> it would be a pointless waste of effort? Or is it the purpose of a
>> digital certificate to prevent that from happening? Is there a
>> mathematical reason?
>
>
>Yes, there we is a well defined relationship between the two. In the
>case of RSA, you take two really big prime numbers and multiply them
>together. The primes are your private key (technically the primes are
>used to find the private key, but it suffices in this discussion to say
>they are the private key), and the product of those primes are your
>public key.
>
>So, generate two huge primes, p and q. Your public key is p*q. The
>reason this is secure is because if I give you p*q (public), it's very
>very very difficult to find what p and q is. You need p and q for the
>private key. Thats why it can't be reversed. It is tied to the
>difficulty of factoring.
>
>
>> I appreciate any explanation that can be given.
>
>Just to clarify a point, here is how encryption and signing works:
>
>If you want to send me an encrypted message, you would use my public
>key and encrypt the message. My private key decrypts it.
>
>If you want to sign a message, you "encrypt" it with your private key.
>The public key is used to "decrypt" this message. Anyone who has your
>public key can "decrypt" it and verify the signature. The reason this
>works is because only you have access to your private key, so only you
>can "encrypt" with the private key.
>
>-Matt

Ah, of course! And you *know* that the message came from a fraudulent
source if your private key couldn't unlock the ciphered data because
of its direct relationship to the *public* key. If the private key
doesn't work on it, the message wasn't encrypted with the proper
corresponding PUBLIC key. And ONLY YOU can decrypt messages meant for
YOU, because your private key is, well, private. ;-)

Am I understanding this correctly? I think I am.

But here's another question . . . who hands out these keys? Where are
they stored? Is it the job of things like VeriSign to do that?

Thanks to everyone for your help.

Similar ThreadsPosted
Visual Cryptography November 9, 2005, 9:16 am
Recover lost Product keys (CD key) for windows... September 14, 2005, 11:57 pm
Online Cryptography course offered by University of Washington June 6, 2006, 10:42 pm
articles related to network security and cryptography September 2, 2007, 4:07 am
BHO Question September 22, 2005, 8:11 am
VPN question February 19, 2006, 8:49 am
SSL question May 5, 2006, 6:41 am
Wi-fi question June 1, 2006, 4:51 am
AVG question July 26, 2006, 7:08 am
Router question June 23, 2005, 3:41 am

The site map in XML format XML site map

Contact Us | Privacy Policy