29
submitted 6 months ago by t0mri@lemmy.ml to c/security@lemmy.ml

There’s a server, a client, and a hacker in a network. For encryption, the client and the server need to share their private keys. Wouldn’t the hacker be able to grab those during their transmission and decrypt further messages as they please?

you are viewing a single comment's thread
view the rest of the comments
[-] Scubus@sh.itjust.works 1 points 6 months ago

But how does the encryption work if you have the public key? Since your computer knows how to encrypt the data with the public key, couldn't you use that same public key to run that algorithm in reverse? If not, since the public and private keys are not the same, how does the private key go about decrypting that data?

[-] RegalPotoo@lemmy.world 3 points 6 months ago

The actual math is way beyond me, but the algorithm is "one way" - it exploits the fact that given two prime numbers (ie, the private key) it is trivial to multiply them together, but if you only know the result (ie, the public key) it is computationally very expensive to determine the original prime factors. If you pick big enough numbers, it becomes effectively impossible to undo the multiplication

[-] slazer2au@lemmy.world 2 points 6 months ago

No. The encryption methods are designed in a way that using a public key will not decrypt the message.

this post was submitted on 28 Apr 2024
29 points (78.4% liked)

Security

5014 readers
1 users here now

Confidentiality Integrity Availability

founded 4 years ago
MODERATORS