Take the 2-minute tour ×

Say Alice and Bob have succeeded in connecting securely to one another via. SSH. Now every time Alice sends some data to Bob, it is encrypted using the RSA algorithm. Given that encrypting takes some time (i.e., selecting primes etc. for every chunk of data), how does SSH manage to do it so quickly, given that the end user notices no lag at all?

share|improve this question

closed as not a real question by Incognito, Nemo, Yahia, Michael Foukarakis, Eugene Mayevski 'EldoS Corp Sep 19 '11 at 6:25


No, each block is not encrypted using RSA. So your question is based on a false premise. RSA is only used for the initial key negotiation; after that, all of the data is encrypted using a (fast) symmetric block cipher. –  Nemo Sep 19 '11 at 3:55
Ah, I see. I was wrongly under the impression that RSA was used to encrypt/decrypt data as well. Thanks! –  Gooner Sep 19 '11 at 3:58
Also, RSA encryption doesn't require selecting primes - only key generation requires that. –  Nick Johnson Sep 19 '11 at 5:36

3 Answers 3

According to the standard the main area where public key cryptography is used by SSH is the key-exchange and cipher negotiation... the supported ciphers are symmetric (like AES) which siginificantly faster than RSA or similar...

The information (for example file content) is encrypted/decrypted according the negotiated cipher (for example AES256) using the negotiated key - see http://www.snailbook.com/docs/transport.txt

share|improve this answer
What happens during transfer of files for e.g.? –  Gooner Sep 19 '11 at 3:52
what I described - the information (file content) is encrypted/decrypted according the negotiated cipher (for example AES256) using the negotiated key –  Yahia Sep 19 '11 at 3:53

You can check out how SSH in lots of places on the Web, but in essence SSH uses public key cryptography to exchange a key which is then used by both sides as a basis for symmetric encryption which is much less compute intensive than the asymmetric encryption used by the public key cryptography.

share|improve this answer

I just took a class on this over the summer and I also found your answer right on wikipedia read the whole operation part

share|improve this answer
I know how SSH works. My question is how does it do it so fast for every block of data? Say, you are transferring a file over SSH. The encryption process is time consuming. –  Gooner Sep 19 '11 at 3:50
If you know how SSH works, you know that it doesn't do that. Perhaps you should re-read that section? –  Nick Johnson Sep 19 '11 at 5:35
