SSL Explained
Cryptography Demystified
Bill Childers
http://wildbill.nulldevice.net/presentations/sslpreso
Agenda
- Why encryption?
- How SSL works
- Digital Certificates
- Practical issues
No Math!
Agenda: Why Encryption?
- PANIC! The risks
- Cryptography objectives
- Everyday uses for cryptography
- Practical issues
"Imagine code arriving over the Internet. It presents its credentials and says, 'I can prove I don't eat children for breakfast; I rarely eat children for lunch.' You know: all these things you'd like to know about a program if you're going to invite it into your home."
Whitfield Diffie
Chief Security Officer
Sun Microsystems
PANIC!
- Stuff we need to do on the Internet
- E-Commerce
- Communication
- Remote working
- Nasty stuff out there
- Identity Theft
- SPAM
- Viruses
- Phishing
Cryptography Objectives
Privacy
Authentication
Non-repudiation
Integrity (Message)
Confidence (ie, trust)
Everyday uses for cryptography
Agenda: SSL
How SSL works
- A Special Intermission
- What is SSL?
- Connecting to a secure web site
- SSL handshaking
A Special Intermission
Whereupon I try to explain a security concept without math, or diagrams, or fumbling for words. Warning, here be dragons. Who's got the beer?
What is SSL?
- Secure Sockets Layer
- Developed by Netscape
- Standardized by IETF as Transport Layer Security (TLS)
Secure Web Example
Secure Web (continued)
- SSL allows us to encrypt stuff for privacy (ie, credit card number)
- Also checks who we are encrypting to for authentication
Is it really Wells Fargo when you do your on-line banking, or is it just a web site made to look like it? (phishing)
SSL Handshaking
SSL Summary
- https://server.domain/
- Browser authenticates the server by using its certificate
- Browser and server negotiate cryptography methods
- Traffic between browser and server is private
PANIC - Where are we?
- Privacy
- Authentication
- Non-Repudiation
- Integrity
- Confidence
Agenda - Digital Certificates
Digital Certificates
- Anatomy
- Digital signatures
Anatomy of a Digital Certificate
Also Important (but not shown):
Issued To: Server FQDN
- Fully Qualified Domain Name
- Common Name (CN)
- Browser checks that FQDN matches CN
Issued To: Continued
- IF the URL does not match the CN of the cert, warn the user
Issued By: Certificate Authority
- Certificate Authority (CA) issues and signs certs
- Browser checks who signed the cert
- Looks up in a list of pre-loaded/trusted CAs
Issued By: Continued
- IF the CA is not known, alert the user
Public Key
- Part of a unique key pair
- Private key stays on the server
- Anything encrypted with the public key can only be decrypted with the private key
- Therefore, anything passed from browser to server via encryption is private
Validity
- Certs are issued for a finite period
- Often 1-2 years for a SSL server cert
- If the webserver presents an expired cert the browser will warn the user
Digital Signature
- Constructed by encrypting the cert contents with the CA's private key
- Does not make anything private
- Anyone who has the CA's public key can decrypt and thereby validate the signature
- The CA's public key can be found on the CA cert
- CA certs are widely distributed
- Hopefully the cert is genuine!
- At some point we need to take a leap of faith and choose who to trust
PANIC - Where are we?
- Privacy
- Authentication
- Non-Repudiation
- Integrity
- Confidence
Digital Certificate Summary
- Digital signature on the cert makes it possible to prove who issued it
Agenda: Practical Issues
- Faster encryption
- Smaller signatures
- Trust
Practical Challenges
- Encrypting/decrypting using public/private keys is very slow
- For the same reason, it is not practical to encrypt a whole document to sign it
- If only the server has a private key, then anything sent to the client will not be encrypted
- We need privacy in both directions
Faster Encryption
- Public keys are long, eg 2048 bits
- Public key encryption is very expensive (CPU intensive)
- Much faster secret key encryption is available - similar to ancient methods
- Encrypt just the secret key with the public key
- Can now use fast secret key encryption for data encryption both ways
Smaller Signatures
- Not necessary to encrypt the whole document with the private key
- Create a hash - like a checksum, but more sophisticated
- Encrypt just the hash
- Quicker and smaller
Smaller Signatures - Continued
Verifying a Signature
PANIC - Where are we?
- Privacy
- Authentication
- Non-Repudiation
- Integrity
- Confidence
Google Homework
- Public Key Algorithms (RSA, DSA, Elliptic-Curve)
- Secret Key Algorithms (DES, 3DES, IDEA, Blowfish, RC4)
- Hash Algorithms (MD5, SHA1, SHA2)
- Standards (TLS, S/MIME, PKCS)
Final Summary
- Encryption Technology is fundamental to the Internet
- Technologies such as SSL provide practical solutions
- Signed digital certificates are the currency of encryption
- Certificates provide a level of trust, but we must still choose who to trust
Who do we ultimately trust?
- Browser comes with pre-trusted certificates
- Ultimately we trust whoever shipped the browser
- Who ships the browser?
- PANIC!
Questions and answers
"When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl."
--Kevin McCurley's Thought for the day, June 24, 1997
Where to find me:
- Linux Journal (Magazine, Web, IRC)
- Twitter: WildBill
- Facebook: wildbillchilders