Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve...

39
Public Key Infrastructure Public Key Infrastructure – tell me in plain English – tell me in plain English AND THEN deep technical how AND THEN deep technical how PKI works PKI works Steve Lamb Steve Lamb [email protected] [email protected] http://blogs.technet.com/steve_lamb http://blogs.technet.com/steve_lamb IT Pro Security Evangelist IT Pro Security Evangelist Microsoft Ltd Microsoft Ltd

Transcript of Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve...

Page 1: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Public Key Infrastructure Public Key Infrastructure – tell me in plain English AND THEN – tell me in plain English AND THEN deep technical how PKI worksdeep technical how PKI works

Steve LambSteve Lamb

[email protected]@microsoft.com

http://blogs.technet.com/steve_lambhttp://blogs.technet.com/steve_lamb

IT Pro Security EvangelistIT Pro Security Evangelist

Microsoft LtdMicrosoft Ltd

Page 2: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

ObjectivesObjectives

Demystify commonly used terminologyDemystify commonly used terminology

Explain how PKI worksExplain how PKI works

Get you playing with PKI in the labGet you playing with PKI in the lab

Make some simple recommendationsMake some simple recommendations

Page 3: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

AgendaAgenda

Foundational Concept (level 200)Foundational Concept (level 200)

PKI and Signatures (level 330)PKI and Signatures (level 330)

Recommendations (level 310)Recommendations (level 310)

Reference material Reference material

Common Algorithms (level 360)Common Algorithms (level 360)

Page 4: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

What can PKI enable?What can PKI enable?

Secure Email – sign and/or encrypt messages

Secure browsing – SSL – authentication and encryption

Secure code – authenticode

Secure wireless – PEAP & EAP-TLS

Secure documents – Rights Management

Secure networks – segmentation via IPsec

Secure files – Encrypted File System(EFS)

Page 5: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Foundational ConceptsFoundational Concepts

Page 6: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Encryption vs. AuthenticationEncryption vs. Authentication

Encrypted information cannot be automatically Encrypted information cannot be automatically trustedtrusted

You still need authenticationYou still need authentication

Which we can implement using encryption, of Which we can implement using encryption, of coursecourse

Page 7: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

AssetsAssets

What we are securing?What we are securing?

DataData

Services (i.e. business etc. applications or their Services (i.e. business etc. applications or their individually accessible parts)individually accessible parts)

This session is not about securing:This session is not about securing:

People (sorry), cables, carpets, typewriters and People (sorry), cables, carpets, typewriters and computers (!?)computers (!?)

Some assets are Some assets are key assetskey assets

Passwords, private keys etc…Passwords, private keys etc…

Page 8: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Digital Security as Extension of Digital Security as Extension of Physical Security of Physical Security of Key AssetsKey Assets

Strong PhysicalStrong PhysicalSecurity of KASecurity of KA

Strong DigitalStrong DigitalSecuritySecurity

Good SecurityGood SecurityEverywhereEverywhere

Weak PhysicalWeak PhysicalSecurity of KASecurity of KA

Strong DigitalStrong DigitalSecuritySecurity

InsecureInsecureEnvironmentEnvironment

Strong PhysicalStrong PhysicalSecurity of KASecurity of KA

Weak DigitalWeak DigitalSecuritySecurity

InsecureInsecureEnvironmentEnvironment

Page 9: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Remember CP and CPS!Remember CP and CPS!

““The Certification Practice & Certification The Certification Practice & Certification Practice Statement (CP/CPS) is a formal Practice Statement (CP/CPS) is a formal statement that describes who may have statement that describes who may have certificates, how certificates are generated and certificates, how certificates are generated and what they may be used for.”what they may be used for.”

http://www.nhsia.nhs.uk/pathology/pages/http://www.nhsia.nhs.uk/pathology/pages/documents/cp_cps.docdocuments/cp_cps.doc

Page 10: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Symmetric Key CryptographySymmetric Key Cryptography

EncryptionEncryption

““The quick The quick brown fox brown fox jumps over jumps over the lazy the lazy dog”dog”

““AxCv;5bmEseTfid3)AxCv;5bmEseTfid3)fGsmWe#4^,sdgfMwifGsmWe#4^,sdgfMwir3:dkJeTsY8R\s@!r3:dkJeTsY8R\s@!q3%”q3%”

““The quick The quick brown fox brown fox jumps over jumps over the lazy the lazy dog”dog”

DecryptionDecryption

Plain-text inputPlain-text input Plain-text outputPlain-text outputCipher-textCipher-text

Same keySame key(shared secret)(shared secret)

Page 11: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Symmetric Pros and ConsSymmetric Pros and Cons

Strength:Strength:

Simple and really very fast (order of 1000 to 10000 Simple and really very fast (order of 1000 to 10000 faster than asymmetric mechanisms)faster than asymmetric mechanisms)

Super-fast (and somewhat more secure) if done in Super-fast (and somewhat more secure) if done in hardware (DES, Rijndael)hardware (DES, Rijndael)

Weakness:Weakness:

Must agree the key beforehandMust agree the key beforehand

Securely pass the key to the other partySecurely pass the key to the other party

Page 12: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Public Key CryptographyPublic Key Cryptography

Knowledge of the Knowledge of the encryptionencryption key doesn’t give key doesn’t give you knowledge of the you knowledge of the decryptiondecryption key key

Receiver of information generates a pair of keys Receiver of information generates a pair of keys

Publish the public key in a directoryPublish the public key in a directory

Then anyone can send him messages that only Then anyone can send him messages that only she can readshe can read

Page 13: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Public Key EncryptionPublic Key Encryption

EncryptionEncryption

““The quick The quick brown fox brown fox jumps over jumps over the lazy the lazy dog”dog”

““Py75c%bn&*)9|Py75c%bn&*)9|fDe^bDFaq#xzjFr@gfDe^bDFaq#xzjFr@g5=&nmdFg$5knvMd’r5=&nmdFg$5knvMd’rkvegMs”kvegMs”

““The quick The quick brown fox brown fox jumps over jumps over the lazy the lazy dog”dog”

DecryptionDecryption

Clear-text InputClear-text Input Clear-text OutputClear-text OutputCipher-textCipher-text

DifferentDifferent keys keys

Recipient’s Recipient’s public keypublic key

Recipient’s Recipient’s private keyprivate key

privatprivatee

publicpublic

Page 14: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Public Key Pros and ConsPublic Key Pros and Cons

Weakness:Weakness:

Extremely slowExtremely slow

Susceptible to “known ciphertext” attackSusceptible to “known ciphertext” attack

Problem of trusting public key (see later on PKI)Problem of trusting public key (see later on PKI)

StrengthStrength

Solves problem of passing the keySolves problem of passing the key

Allows establishment of trust context between Allows establishment of trust context between partiesparties

Page 15: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Hybrid Encryption (Real World)Hybrid Encryption (Real World)

As above, repeated As above, repeated for other recipientsfor other recipientsor recovery agentsor recovery agents

DigitalDigitalEnvelopeEnvelope

Other recipient’s or Other recipient’s or agent’s agent’s publicpublic key key (in certificate)(in certificate)in recovery policyin recovery policy

Launch keyLaunch keyfor nuclearfor nuclear

missile missile ““RedHeat” RedHeat”

is...is...

Symmetric key Symmetric key encrypted asymmetrically encrypted asymmetrically

(e.g., RSA)(e.g., RSA)

Digital Digital EnvelopeEnvelope

User’sUser’spublicpublic key key(in certificate)(in certificate)

RNGRNG

Randomly-Randomly-Generated Generated symmetricsymmetric“session” key “session” key

SymmetricSymmetric encryption encryption(e.g. DES)(e.g. DES)

*#$fjda^j*#$fjda^ju539!3tu539!3t

t389E *&\@t389E *&\@5e%32\^kd5e%32\^kd

Page 16: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

*#$fjda^j*#$fjda^ju539!3tu539!3t

t389E *&\@t389E *&\@5e%32\^kd5e%32\^kd

Launch keyLaunch keyfor nuclearfor nuclear

missile missile ““RedHeat” RedHeat”

is...is...

Launch keyLaunch keyfor nuclearfor nuclear

missile missile ““RedHeat” RedHeat”

is...is...

SymmetricSymmetricdecryption decryption (e.g. DES)(e.g. DES)

Digital Digital EnvelopeEnvelope

Asymmetric Asymmetric decryption of decryption of

“session” key (e.g. RSA)“session” key (e.g. RSA)

Symmetric Symmetric “session” key“session” key

Session key must be Session key must be decrypted using the decrypted using the recipient’s recipient’s private private keykey

Digital envelope Digital envelope contains “session” contains “session” key encrypted key encrypted using recipient’s using recipient’s public keypublic key

Recipient’s Recipient’s privateprivate keykey

Hybrid DecryptionHybrid Decryption

Page 17: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

PKI and SignaturesPKI and Signatures

Page 18: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Public Key Distribution ProblemPublic Key Distribution Problem

We just solved the problem of symmetric key distribution We just solved the problem of symmetric key distribution by using public/private keysby using public/private keys

But…But…

Scott creates a keypair (private/public) and quickly tells Scott creates a keypair (private/public) and quickly tells the world that the public key he published belongs to Billthe world that the public key he published belongs to Bill

People send confidential stuff to BillPeople send confidential stuff to Bill

Bill does not have the private key to read them…Bill does not have the private key to read them…

Scott reads Bill’s messages Scott reads Bill’s messages

Page 19: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Eureka!Eureka!

We need PKI to solve that problemWe need PKI to solve that problem

And a few others…And a few others…

Page 20: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Creating a Digital SignatureCreating a Digital Signature

Hash Hash Function Function

(SHA, MD5)(SHA, MD5)

Jrf843kjfgf*Jrf843kjfgf*££$&Hdif*7oU$&Hdif*7oUsd*&@:<CHsd*&@:<CHDFHSD(**DFHSD(**

Py75c%bn&*)9|Py75c%bn&*)9|fDe^bDFaq#xzjFr@gfDe^bDFaq#xzjFr@g5=&nmdFg$5knvMd’r5=&nmdFg$5knvMd’rkvegMs”kvegMs”

This is a This is a really long really long message message about about Bill’s…Bill’s…

AsymmetricAsymmetricEncryptionEncryption

Message or FileMessage or File Digital SignatureDigital Signature128 bits 128 bits Message DigestMessage Digest

Calculate a short Calculate a short message digest from message digest from even a long input even a long input using a one-way using a one-way message digest message digest function (hash)function (hash)

Signatory’s Signatory’s privateprivate key key

privatprivatee

Page 21: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Verifying a Digital SignatureVerifying a Digital Signature

Jrf843kjfJrf843kjfgf*£$&Hdgf*£$&Hdif*7oUsdif*7oUsd

*&@:<CHD*&@:<CHDFHSD(**FHSD(**

Py75c%bn&*)Py75c%bn&*)9|fDe^bDFaq9|fDe^bDFaq#xzjFr@g5=#xzjFr@g5=

&nmdFg$5kn&nmdFg$5knvMd’rkvegMs”vMd’rkvegMs”

Py75c%bn&*)Py75c%bn&*)9|fDe^bDFaq9|fDe^bDFaq#xzjFr@g5=#xzjFr@g5=

&nmdFg$5kn&nmdFg$5knvMd’rkvegMs”vMd’rkvegMs”

AsymmetricAsymmetricdecryption decryption (e.g. RSA)(e.g. RSA)

Everyone has Everyone has access to trusted access to trusted public key of the public key of the signatorysignatory

Signatory’s Signatory’s publicpublic keykey

Digital SignatureDigital Signature

This is a This is a really long really long message message

about Bill’s…about Bill’s…

Same hash functionSame hash function(e.g. MD5, SHA…)(e.g. MD5, SHA…)

Original MessageOriginal Message

Py75c%bn&*)Py75c%bn&*)9|fDe^bDFaq9|fDe^bDFaq#xzjFr@g5=#xzjFr@g5=

&nmdFg$5kn&nmdFg$5knvMd’rkvegMs”vMd’rkvegMs”

Py75c%bn&*)Py75c%bn&*)9|fDe^bDFaq9|fDe^bDFaq#xzjFr@g5=#xzjFr@g5=

&nmdFg$5kn&nmdFg$5knvMd’rkvegMs”vMd’rkvegMs”

? == ?? == ?Are They Same?Are They Same?

Page 22: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Word About SmartcardsWord About Smartcards

Some smartcards are “dumb”, i.e. they are only a memory Some smartcards are “dumb”, i.e. they are only a memory chipchip

Not recommended for storing a private key used in a challenge Not recommended for storing a private key used in a challenge test (verifying identity)test (verifying identity)

Anyway, they are still better than leaving keys on a floppy disk or Anyway, they are still better than leaving keys on a floppy disk or on the hard driveon the hard drive

Cryptographically-enabled smartcards are more expensive Cryptographically-enabled smartcards are more expensive but they give much more securitybut they give much more security

Private key is secure and used as neededPrivate key is secure and used as needed

Additional protection (password, biometrics) is possibleAdditional protection (password, biometrics) is possible

Hardware implements some algorithmsHardware implements some algorithms

Self-destruct is possibleSelf-destruct is possible

Page 23: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

RecommendationsRecommendationsDon’t be scared of PKI!Don’t be scared of PKI!

Set up a test environment to enable hyou to Set up a test environment to enable hyou to “play”“play”

Minimise the scope of your first implementationMinimise the scope of your first implementation

Read up on CP & CPSRead up on CP & CPS

Document the purpose and operating Document the purpose and operating procedures of your PKIprocedures of your PKI

Page 24: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

SummarySummary

Cryptography is a rich and amazingly mature Cryptography is a rich and amazingly mature fieldfield

We all rely on it, everyday, with our livesWe all rely on it, everyday, with our lives

Know the basics and make good choices Know the basics and make good choices avoiding common pitfallsavoiding common pitfalls

Plan your PKI earlyPlan your PKI early

Avoid very new and unknown solutionsAvoid very new and unknown solutions

Certificate Policy Certificate Policy

Certification Practises statementCertification Practises statement

Page 25: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

ReferencesReferences

Visit www.microsoft.com/security Visit www.microsoft.com/security

Read sci.crypt (incl. archives)Read sci.crypt (incl. archives)

Attend SEC499 for “Encryption in Detail” on Friday at Attend SEC499 for “Encryption in Detail” on Friday at 14.45 in Room 114.45 in Room 1

For more detail, read:For more detail, read:Cryptography: An Introduction, Cryptography: An Introduction, N. Smart, McGraw-Hill, ISBN 0-07-709987-7N. Smart, McGraw-Hill, ISBN 0-07-709987-7

Practical Cryptography, Practical Cryptography, N. Ferguson & B. Schneier, Wiley, ISBN 0-471-22357-3N. Ferguson & B. Schneier, Wiley, ISBN 0-471-22357-3

Contemporary Cryptography, Contemporary Cryptography, R. Oppliger, Artech House, ISBN 1-58053-642-5 (to R. Oppliger, Artech House, ISBN 1-58053-642-5 (to be published May 2005, see http://www.esecurity.ch/Books/cryptography.html)be published May 2005, see http://www.esecurity.ch/Books/cryptography.html)

Applied CryptographyApplied Cryptography, B. Schneier, John Wiley & Sons, ISBN 0-471-11709-9, B. Schneier, John Wiley & Sons, ISBN 0-471-11709-9

Handbook of Applied CryptographyHandbook of Applied Cryptography, A.J. Menezes, CRC Press, ISBN 0-8493-, A.J. Menezes, CRC Press, ISBN 0-8493-8523-7, 8523-7, www.cacr.math.uwaterloo.ca/hacwww.cacr.math.uwaterloo.ca/hac (free PDF) (free PDF)PKI, PKI, A. Nash et al., RSA Press, ISBN 0-07-213123-3A. Nash et al., RSA Press, ISBN 0-07-213123-3

Foundations of CryptographyFoundations of Cryptography, O. Goldereich, , O. Goldereich, www.eccc.uni-trier.de/eccc-local/ECCC-Books/oded_book_readme.htmlwww.eccc.uni-trier.de/eccc-local/ECCC-Books/oded_book_readme.html

Cryptography in C and C++Cryptography in C and C++, M. Welschenbach, Apress, , M. Welschenbach, Apress, ISBN 1-893115-95-X (includes code samples CD)ISBN 1-893115-95-X (includes code samples CD)

Page 26: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Copyright 2004 © Project Botticelli Ltd & Microsoft Corp. E&OE. For informational purposes only. No warranties of Copyright 2004 © Project Botticelli Ltd & Microsoft Corp. E&OE. For informational purposes only. No warranties of any kind are made and you have to verify all information before relying on it. You can re-use this presentation as any kind are made and you have to verify all information before relying on it. You can re-use this presentation as

long as you read, agree, and follow the guidelines described in the “Comments” field in File/Properties.long as you read, agree, and follow the guidelines described in the “Comments” field in File/Properties.

Thanks to Rafal Lukawiecki for providing some of the content Thanks to Rafal Lukawiecki for providing some of the content for this presentation deck – his contact details are as for this presentation deck – his contact details are as follows…follows…

[email protected]@projectbotticelli.co.uk

Strategic Consultant, Project Botticelli LtdStrategic Consultant, Project Botticelli Ltd

Page 27: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Common AlgorithmsCommon Algorithms

Page 28: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

DES, IDEA, RC2, RC5, TwofishDES, IDEA, RC2, RC5, TwofishSymmetricSymmetric

DES (Data Encryption Standard) is still the most popularDES (Data Encryption Standard) is still the most popular

Keys very short: 56 bitsKeys very short: 56 bits

Brute-force attack took 3.5 hours on a machine costing US$1m in Brute-force attack took 3.5 hours on a machine costing US$1m in 1993. Today it is done real-time1993. Today it is done real-time

Triple DES (3DES) more secure, but better options aboutTriple DES (3DES) more secure, but better options about

Just say no, unless value of data is minimalJust say no, unless value of data is minimal

IDEA (International Data Encryption Standard)IDEA (International Data Encryption Standard)

Deceptively similar to DES, and “not” from NSADeceptively similar to DES, and “not” from NSA

128 bit keys128 bit keys

RC2 & RC5 (by R. Rivest)RC2 & RC5 (by R. Rivest)

RC2 is older and RC5 newer (1994) - similar to DES and IDEARC2 is older and RC5 newer (1994) - similar to DES and IDEA

Blowfish, TwofishBlowfish, Twofish

B. Schneier’s replacement for DES, followed by Twofish, one of the B. Schneier’s replacement for DES, followed by Twofish, one of the NIST competition finalistsNIST competition finalists

Page 29: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Rijndael (AES)Rijndael (AES)

Standard replacement for DES for US government, and, Standard replacement for DES for US government, and, probably for all of us as a result…probably for all of us as a result…

Winner of the AES (Advanced Encryption Standard) Winner of the AES (Advanced Encryption Standard) competition run by NIST (National Institute of Standards and competition run by NIST (National Institute of Standards and Technology in US) in 1997-2000Technology in US) in 1997-2000

Comes from Europe (Belgium) by Joan Daemen and Vincent Comes from Europe (Belgium) by Joan Daemen and Vincent Rijmen. “X-files” stories less likely (unlike DES). Rijmen. “X-files” stories less likely (unlike DES).

Symmetric block-cipher (128, 192 or 256 bits) with Symmetric block-cipher (128, 192 or 256 bits) with variable keys (128, 192 or 256 bits, too)variable keys (128, 192 or 256 bits, too)

Fast and a lot of good properties, such as good immunity Fast and a lot of good properties, such as good immunity from timing and power (electric) analysisfrom timing and power (electric) analysis

Construction, again, deceptively similar to DES (S-Construction, again, deceptively similar to DES (S-boxes, XORs etc.) but boxes, XORs etc.) but reallyreally different different

Page 30: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

CAST and GOSTCAST and GOST

CASTCAST

Canadians Carlisle Adams & Stafford TavaresCanadians Carlisle Adams & Stafford Tavares

64 bit key and 64 bit of data64 bit key and 64 bit of data

Chose your S-boxesChose your S-boxes

Seems resistant to differential & linear cryptanalysis and only Seems resistant to differential & linear cryptanalysis and only way to break is brute force (but key is a bit short!)way to break is brute force (but key is a bit short!)

GOSTGOST

Soviet Union’s “version” of DES but with a clearer design and Soviet Union’s “version” of DES but with a clearer design and many more repetitions of the processmany more repetitions of the process

256 bit key but really 610 bits of secret, so pretty much “tank 256 bit key but really 610 bits of secret, so pretty much “tank quality”quality”

Backdoor? Who knows…Backdoor? Who knows…

Page 31: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Careful with Streams!Careful with Streams!

Do NOT use a block cipher in a loopDo NOT use a block cipher in a loop

Use a crypto-correct technique for treating Use a crypto-correct technique for treating streams of data, such as CBC (Cipher Block streams of data, such as CBC (Cipher Block Chaining)Chaining)

For developers: For developers:

.NET Framework implements it as ICryptoTransform on a .NET Framework implements it as ICryptoTransform on a crypto stream with any supported algorithmcrypto stream with any supported algorithm

Page 32: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

RC4RC4

SymmetricSymmetricFast, streaming encryptionFast, streaming encryption

R. Rivest in 1994R. Rivest in 1994Originally secret, but “published” on sci.cryptOriginally secret, but “published” on sci.crypt

Related to “one-time pad”, theoretically most secureRelated to “one-time pad”, theoretically most secure

But!But!

It relies on a really good random number generatorIt relies on a really good random number generatorAnd that is the problemAnd that is the problem

Nowadays, we tend to use block ciphers in modes of Nowadays, we tend to use block ciphers in modes of operation that work for streamsoperation that work for streams

Page 33: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

RSA, DSA, ElGamal, ECCRSA, DSA, ElGamal, ECCAsymmetricAsymmetric

Very slow and computationally expensive – need a computerVery slow and computationally expensive – need a computer

Very secureVery secure

Rivest, Shamir, Adleman – 1978Rivest, Shamir, Adleman – 1978Popular and well researchedPopular and well researched

Strength in today’s inefficiency to factorise into prime numbersStrength in today’s inefficiency to factorise into prime numbers

Some worries about key generation process in some implementationsSome worries about key generation process in some implementations

DSA (Digital Signature Algorithm) – NSA/NIST thingDSA (Digital Signature Algorithm) – NSA/NIST thingOnly for digital signing, not for encryptionOnly for digital signing, not for encryption

Variant of Schnorr and ElGamal sig algorithmVariant of Schnorr and ElGamal sig algorithm

ElGamalElGamalRelies on complexity of discrete logarithmsRelies on complexity of discrete logarithms

ECC (Elliptic Curve Cryptography)ECC (Elliptic Curve Cryptography)Really hard maths and topologyReally hard maths and topology

Improves RSA (and others)Improves RSA (and others)

Page 34: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Quantum CryptographyQuantum Cryptography

Method for generating and passing a secret key or a random streamMethod for generating and passing a secret key or a random stream

Not for passing the actual data, but that’s irrelevantNot for passing the actual data, but that’s irrelevant

Polarisation of light (photons) can be detected only in a way that Polarisation of light (photons) can be detected only in a way that destroys the “direction” (basis)destroys the “direction” (basis)

So if someone other than you observes it, you receive nothing useful So if someone other than you observes it, you receive nothing useful and you know you were buggedand you know you were bugged

Perfectly doable over up-to-120km dedicated long fibre-optic linkPerfectly doable over up-to-120km dedicated long fibre-optic link

Seems pretty perfect, if a bit tedious and slowSeems pretty perfect, if a bit tedious and slow

Practical implementations still use AES/DES etc. for actual encryptionPractical implementations still use AES/DES etc. for actual encryption

Magiq QPN: http://www.magiqtech.com/press/qpn.pdf Magiq QPN: http://www.magiqtech.com/press/qpn.pdf

Don’t confuse it with quantum computing, which won’t be with us for Don’t confuse it with quantum computing, which won’t be with us for at least another 50 years or so, or maybe longer…at least another 50 years or so, or maybe longer…

Page 35: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

MD5, SHAMD5, SHA

Hash functions – not encryption at all!Hash functions – not encryption at all!

Goals:Goals:

Not reversible: can’t obtain the message from its hashNot reversible: can’t obtain the message from its hash

Hash much shorter than originalHash much shorter than original

Two messages won’t have the same hashTwo messages won’t have the same hash

MD5 (R. Rivest)MD5 (R. Rivest)

512 bits hashed into 128512 bits hashed into 128

Mathematical model still unknownMathematical model still unknown

But it resisted major attacksBut it resisted major attacks

SHA (Secure Hash Algorithm)SHA (Secure Hash Algorithm)

US standard based on MD5US standard based on MD5

Page 36: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Diffie-Hellman, “SSL”, CertsDiffie-Hellman, “SSL”, Certs

Methods for key generation and exchangeMethods for key generation and exchange

DH is very clever since you always generate a new “key-DH is very clever since you always generate a new “key-pair” for each asymmetric sessionpair” for each asymmetric session

STS, MTI, and certs make it even saferSTS, MTI, and certs make it even safer

Certs (certificates) are the most common way to Certs (certificates) are the most common way to exchange public keysexchange public keys

Foundation of Public Key Infrastructure (PKI)Foundation of Public Key Infrastructure (PKI)

SSL uses a protocol to exchange keys safelySSL uses a protocol to exchange keys safely

See laterSee later

Page 37: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

CryptanalysisCryptanalysis

Brute forceBrute force

Good for guessing passwords, and some 40-bit symmetric keys (in Good for guessing passwords, and some 40-bit symmetric keys (in some cases needed only 27 attempts)some cases needed only 27 attempts)

Frequency analysisFrequency analysis

For very simple methods only (US mobiles)For very simple methods only (US mobiles)

Linear cryptanalysisLinear cryptanalysis

For stronger DES-like, needs 243 plain-cipher pairsFor stronger DES-like, needs 243 plain-cipher pairs

Differential cryptanalysisDifferential cryptanalysis

Weaker DES-like, needs from 214 pairsWeaker DES-like, needs from 214 pairs

Power and timing analysisPower and timing analysis

Fluctuations in response times or power usage by CPUFluctuations in response times or power usage by CPU

Page 38: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Strong SystemsStrong Systems

It is always a mixture! Changes all the time…It is always a mixture! Changes all the time…

Symmetric:Symmetric:

AES, min. 128 bits for RC2 & RC5, 3DES, IDEA, carefully AES, min. 128 bits for RC2 & RC5, 3DES, IDEA, carefully analysed RC4, 256 bit betteranalysed RC4, 256 bit better

Asymmetric:Asymmetric:

RSA, ElGamal, Diffie-Hellman (for keys) with minimum 1024 RSA, ElGamal, Diffie-Hellman (for keys) with minimum 1024 bits (go for the maximum, typically 4096, if you can afford it)bits (go for the maximum, typically 4096, if you can afford it)

Hash:Hash:

Either MD5 or SHA but with at least 128 bit results, 256 betterEither MD5 or SHA but with at least 128 bit results, 256 better

Page 39: Public Key Infrastructure – tell me in plain English AND THEN deep technical how PKI works Steve Lamb stephlam@microsoft.com .

Weak SystemsWeak Systems

Anything with 40-bits (including 128 and 56 bit versions Anything with 40-bits (including 128 and 56 bit versions with the remainder “fixed”)with the remainder “fixed”)

Most consider DES as fairly weak algorithmMost consider DES as fairly weak algorithm

CLIPPERCLIPPER

A5 (GSM mobile phones outside US)A5 (GSM mobile phones outside US)

Vigenère (US mobile phones)Vigenère (US mobile phones)

Dates from 1585!Dates from 1585!

Unverified certs with no trustUnverified certs with no trust

Weak certs (as in many “class 1” personal certs)Weak certs (as in many “class 1” personal certs)