SunQuest
           Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 28th, 2008, 08:53 PM
Calamity Calamity is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Location: France
Posts: 3 Calamity User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 57 sec
Reputation Power: 0
Send a message via MSN to Calamity
SSL - Why using a symmetric cipher ?

Hi everybody,

I recently discovered the principles of SSL (on Wikipedia) and there is something I don't understand.

What is the point of using RSA to encrypt a keystream (usually generated by RC4) and then sending the encrypted keystream and the "keystream XOR message" whereas we could use RSA to encrypt the message itself and then we would not need to use RC4 at all ?

I think there must be an explanation but I can't find it ... any suggestion ?

Thanks

Reply With Quote
  #2  
Old March 28th, 2008, 10:16 PM
B-Con's Avatar
B-Con B-Con is offline
Crypto-Con
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Apr 2004
Location: UC Davis
Posts: 6,647 B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 5 Days 17 h 55 m 33 sec
Reputation Power: 852
Public key encryption is expensive, CPU-wise. The longer the message, the exponentially longer it takes to encrypt. It's *way* more efficient to encrypt a short string asymmetrically, then encrypt the normal data symmetrically, than it is to encrypt the entire data stream asymmetrically.

This is common practice almost everywhere that involves public key crypto. Almost any time you see public key crypto used, it's either to a) sign a document, or b) to exchange a symmetric key.

No security loss, but all the easier on your computer. Keeps the server from needing 90% CPU for 2 minutes every time you request a new https page.
__________________
- "Cryptographically secure linear feedback shift register based stream ciphers" -- a phrase that'll get any party started.
- Why know the ordinary when you can understand the extraordinary?


- Sponsor my caffeine addiction! (36.70 USD recieved so far -- Latest donor: Mark Foxvog
)

Last edited by B-Con : March 28th, 2008 at 10:19 PM.

Reply With Quote
  #3  
Old March 28th, 2008, 11:40 PM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 964 fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 23 h 26 m 10 sec
Reputation Power: 418
What B-con said.

And, you can only encipher as much data as the RSA key length. So if you have a 1024 bit key (128 octets) then you can only protect 128 bytes at a time. If you needed to protect say 1100 bytes, you would have to do ten RSA operations. It might takes minutes.

Reply With Quote
  #4  
Old March 29th, 2008, 05:42 AM
Calamity Calamity is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Location: France
Posts: 3 Calamity User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 57 sec
Reputation Power: 0
Send a message via MSN to Calamity
Ok thank you I think I understand.

Just to be sure : what is asymmetrically encrypted is only the seed which is used to generate the keystream in order to apply a XOR between this keystream and the message itself ?

Reply With Quote
  #5  
Old March 29th, 2008, 10:26 AM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 964 fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 23 h 26 m 10 sec
Reputation Power: 418
Normal practice is for Alice to randomly generate a 'session key'. Its just a random block of bits. Alice then uses Bob's public RSA key, and encrypts the session key, sends it to Bob.

Then Alice uses the session key with a block or stream cipher to encipher the secret message. Alice sends the ciphertext to Bob, who uses the session key to decipher it.

Some protocols send the whole thing in one transmission, others send parts separately. Make no difference at the 30,000 foot level

Reply With Quote
  #6  
Old March 29th, 2008, 06:51 PM
B-Con's Avatar
B-Con B-Con is offline
Crypto-Con
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Apr 2004
Location: UC Davis
Posts: 6,647 B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level)B-Con User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 5 Days 17 h 55 m 33 sec
Reputation Power: 852
Quote:
Originally Posted by Calamity
Ok thank you I think I understand.

Just to be sure : what is asymmetrically encrypted is only the seed which is used to generate the keystream in order to apply a XOR between this keystream and the message itself ?
What fish said.

In specific, with your RC4 example in the beginning, the session key is used to seed the RC4 PRNG which then produces the pseudo-random string used to XOR against the plaintext, if that's what you're wondering about.

Reply With Quote
  #7  
Old March 29th, 2008, 07:05 PM
Calamity Calamity is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Location: France
Posts: 3 Calamity User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 57 sec
Reputation Power: 0
Send a message via MSN to Calamity
Yes it is

Thank you.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > SSL - Why using a symmetric cipher ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway