Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionLet's say for example, there is a client and a server. They have both exchanged public keys with each other. Now how is public key encryption applied when downloading the data from the server to the client?
The server encrypts with it's private key and this data can be decrypted with the public key (and vice-versa). The numbers and the algorithm are made like this - they don't need to know each others' private keys.
One of the simpler algorithms is called RSA, you can find more on how it works on Wikipedia. You'll need some maths, but nothing very complicated there.
For performance reasons, public key cryptography is used only for transmitting a normal, symmetric key.
digital certificates are used in that case which carries users public key in an encrypted form. A server has it's own certificate and a client also has one which are then matched before the downloading starts.
精彩评论