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:
  #1  
Old April 28th, 2009, 01:35 PM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 108 airdesign Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 13 h 36 m 22 sec
Reputation Power: 0
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
Question Https

Hello everyone,

I am a website designer but am trying hard to increase my awareness and knowledge of internet security related issues.

I wonder if you guys could help me first with a really simple question:

my understanding of HTTPS is that it is not enormously secure. If I understand its workings correctly, a private key is agreed on in plain text transmission before encrypted messages begin, meaning that if someone is snooping on packets between the client and the server, they can utilise this private key to crack the following encrypted messages. Is this incorrect? Have I completely misunderstood this?

Many thanks! :-)

Reply With Quote
  #2  
Old April 28th, 2009, 02:20 PM
mah$us mah$us is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 62 mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 5 h 7 m 33 sec
Reputation Power: 19
Yes, you have completely misunderstood this!

If you take a minute to think about it, the motivation for SSL/TLS (TLS is the more up-to-date standard) is that internet connections can be snooped by eavesdroppers, this is why encryption is used. If keys were exchanged in the clear, there would be no security benefit at all!

There are ways to set up session keys that are designed not only to protect against eavesdropping (snooping), but also against an adversary intercepting AND REPLACING packets, so as to impersonate each side to the other (this is called a man-in-the-middle or MITM attack). SSL/TLS uses such protocols.

You can start your education here:

http://en.wikipedia.org/wiki/Secure_Sockets_Layer

So, SSL/TLS doesn't make the elementary blunder you were concerned about. But the security it provides is debatable, and debated. Maybe the biggest weakness is that certificates (used to authenticate the identity of servers) aren't managed carefully enough, lots of legit websites use bad certificates, and users often ignore the browser warning that there is problem with the certificate. Because of these problems, if Badguy Inc. sets up a server on a domain that looks like goodguys.com, there's a good chance that people will get fooled. Sigh.

Maybe the worst mistake so far happened (only a couple of years ago) in Debian Linux distributions: some f**kwit altered crypto code he didn't understand (because his super-duper-lint program complained), and made key generation completely insecure. If such keys were used for signing certificates, forgery became easy. Sigh.

As far as I know, SSL/TLS is a well-designed system. But the defense is only as strong as its weakest point...

Reply With Quote
  #3  
Old April 28th, 2009, 02:35 PM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 108 airdesign Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 13 h 36 m 22 sec
Reputation Power: 0
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
Thanks so much for your reply and taking the time to educate me.

I understand about the MITM attacks, I just haven't quite got my head around how two computers can talk to each other in code, if they haven't already in plain text discussed what code they are going to encrypt their later communications in. How does this actually work?

I mean, I have read the SLS/TLS wiki page and understand what is says about the handshake... "The server responds with a ServerHello message, containing the chosen protocol version, a random number, cipher suite....... and PreMasterSecret". Surely if the random number and the PreMasterSecret is transmitted in plain text, a hacker who listens to the communications of the client can comprehend later communications between the client and the server?

Is my misunderstanding being stubborn, I apologise!

Thanks for the explanation of the context regarding the certificates... you talked about 'dodgy' certificates, right? Is this why FF3 attempts to contact the original CA to check whether the certificate is kosher?

Reply With Quote
  #4  
Old April 28th, 2009, 05:16 PM
mah$us mah$us is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 62 mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level)mah$us User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 5 h 7 m 33 sec
Reputation Power: 19
Quote:
Originally Posted by airdesign
I just haven't quite got my head around how two computers can talk to each other in code, if they haven't already in plain text discussed what code they are going to encrypt their later communications in. How does this actually work?


Public-key cryptography makes possible various seemingly impossible things. It was my curiosity about "how the hell do they do that?" that prompted me to pick up a crypto textbook around 2002.

Here's a couple of highly oversimplified answers, that I hope may inspire you to learn more.

[1] With a public-key cryptosystem (RSA being the most famous, and also very widely used), I can publish my key in a newspaper, on a web page, etc. Anyone can use this key to encrypt a message that only I can decrypt.

So suppose that you and I want to start a conversation secure from eavesdropping: I could begin by sending you my public key. You can then generate a random session key (for a block cipher like AES), encrypt it using my public key, and send that to me. We now share the session key, but the eavesdropper doesn't know it: he only has an encrypted version that he can't decrypt.

[1a] In the above scenario, if I'm impersonating the person you thought you were talking to, we have a "secure" connection, but your data is going to the wrong guy!

It is because of such scenarios, that certificates are required. Certificates are designed to be unforgeable. When I start the conversation, I send you my certificate. The cert probably already has the key you will use to encrypt the session key: if it doesn't, I sign the key I'm sending you, and you will verify that it's my signature using the signature verification key in my cert.

Keep in mind that this is highly oversimplified, but the proper use of certificates will defeat impersonation attacks including MITM.

[2] Diffie and Hellman (authors of the very first published paper on public key crypto) came up with a different way, that is crushing in its simplicity. Using an agreed number (that can be completely public), I raise this number (call it g) to a randomly chosen exponent, which we'll call a, and send it to you. You'll choose your own random exponent b, raise the base to this power, and send it to me. Each of us takes the number we received, and raise it to our secret exponent. So you compute (g**a)**b, and I compute (g**b)**a. Either way, it's the same as g**(a*b), so we have computed the same number, which we can use as our session key.

The eavesdropper has both g**a and g**b, but there is no practical way for him to compute g**(a*b). How cool is that?

NOTE 1: For Diffie-Hellman to be secure, the exponents have to be enormous (many hundreds of decimal digits). It's only possible to compute such enormous powers within a finite mathematical group (finite, but huge). The group must be chosen so that the logarithm problem (the inverse of exponentiation) is too expensive to compute; otherwise, the attacker can take the logarithm of g**a to find a, and then re-create the session key. I didn't know anything about finite groups when I started studying crypto, but my textbooks and self-study helped me to learn, and to me this stuff is fascinating.

NOTE 2: The Diffie-Hellman key-exchange protocol (described above) is pretty obviously vulnerable to MITM attacks, so it must be "beefed up" with certificates and more message exchanges to be secure.

Reply With Quote
  #5  
Old April 28th, 2009, 06:24 PM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 108 airdesign Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 13 h 36 m 22 sec
Reputation Power: 0
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
Goodness, that is absolutely amazing - indeed, I am inspired!

That really is just fascinating and I will pursue this further.

Thanks again for your energy and effort.

Truly grateful.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Https


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




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
Stay green...Green IT