570 likes | 596 Views
Demystifying PKI : Introduction to The Cryptography Behind Public Key Infrastructure. Security Services. Data Integrity Verification that the data has not been modified Authentication e.g., your personal signature Non-Repudiation e.g., Sender/Receiver in a financial transaction
E N D
Demystifying PKI: Introduction to The Cryptography Behind Public Key Infrastructure
Security Services • Data Integrity • Verification that the data has not been modified • Authentication • e.g., your personal signature • Non-Repudiation • e.g., Sender/Receiver in a financial transaction • Confidentiality • i.e., scrambled text
Data Integrity • The Assurance That the Data Has Arrived Intact, With No Tampering or Corruption of the Bits. • Data Integrity Is Achieved Electronically Through the Use of Cryptographic Checksums (One-way Hashes) Over the Data.
“$” “1” “0” “9” 36 49 48 57 3725 Data Integrity Hash Functions • Hash Functions are Complex Mathematical Functions Which Generate a Unique “Fingerprint” of the Data. Each String of Data is Mathematically Reduced to a Fixed-Size Output Block, Regardless of the Amount of Input Data • The Same Output is Always Produced From The Same Input User Data Hash Function Two Examples: Secure Hash Algorithm (SHA) Message Digest #5 [RSA] (MD-5) The Result Produced By a Hashing Function is Called a Message Digest
Authentication • The Binding of the Sender’s (or Issuer’s) Credentials to the Data. This Process Can Be Likened to Your Personal Signature • It Is Unique to You and Can Be Recognized (Verified) Later by All Parties Involved
Non-Repudiation • The Fact That a Third Party Can Verify Your Authentication (e.g., Your Signature) on a Transaction Means That You Cannot Deny Participation in the Transaction
Confidentiality/Privacy • Encryption (scrambling) of the data to prevent unauthorized disclosure.
Mechanics of Security • Cryptographic algorithms (mathematical processes) used to implement security • Symmetric vs. Asymmetric • Key Generation • Digital Signatures • Encryption • Public Key Infrastructure
Encryption Algorithms • Encryption Has Historically Been Used in Military Applications to Secure Tactical or Intelligence Related Information During Wartime. For This Reason, Encryption Is Classified As a Munition or Instrument of Warby Most Countries. The Improper Use of Encryption Is Often Considered a Terrorist Act. Many Countries Place Restrictions on the Import and Export of Encryption, as Well as the Use of Encryption Within the Country.
Encryption Algorithms “The problem of good cipher design is essentially one of finding difficult problems..... we may construct our cipher in such a way that breaking it is equivalent to... the solution of some problem known to be laborious.” - Claude Shannon (1949)
Key=010011..1 Key=010011..1 Conventional Algorithms • Also Called Secret-Key Algorithms • Symmetric - Use The Same Key For Encryption and Decryption • Security Depends on Keeping the Session Key Secret Encryption Decryption
Symmetric Encryption/Decryption • Secret Key used to encrypt data • Sender and receiver must have same key • Key distribution and compromise recovery are difficult Key Generation Secret Key Secret Key Same Key 12A7BC544109FD00A6293FECC7293B9BCAA12020384AC6F4D93B8 This is plain text. It can be a document, image, or any other data file DES DES This is plain text. It can be a document, image, or any other data file SENDER RECEIVER
Conventional Algorithms • Stream Ciphers • Perform a Mathematical Transformation Using One Bit From the Key String and One Bit From the Data Stream. • The Classic Stream Cipher Is Called a Vernam Cipher • It is Based on the Exclusive OR Function
Stream Ciphers Vernam Cipher Repeating Key Stream = 101001011 101001011 101001011 ... 101001011 .XOR. + Message = Debit $500 101101011101101011101101011 ... CryptoText E%f2$Uz7@W
Block Ciphers • Perform a Mathematical Transformation On Data In Fixed-Size Blocks, One At a Time. • The Cipher Mode Determines How The Algorithm Is Applied To Data Streams, Block-By-Block • Block Ciphers are Fairly Similar From a Functional Point-of-View • We’ll Now Look at an Example of One Well-Known Block Cipher in Detail...
DES Algorithm Message Encrypted Message Encrypt DES Key
64-Bit Block of Original Text Anatomy of DES Original Message Stream is Broken Into 64-Bit Blocks (8 Ascii Characters) Each Block is Separately Fed Into The DES Algorithm (Hence the Term Block Cipher)
56-Bit Key Anatomy of DES 64-Bit Block of Original Text The Original DES Key is 64 Bits The Keysize is Reduced to 56 Bits During The Initial Permutation The Reduced 56-Bit Key Becomes The Working DES Session Key Initial Permutation Bits 8,16,24,32,40,48,56,64
32-Bit Right Half 48-Bit ExpandedRight Half Anatomy of DES 64-Bit Block of Original Text 56-Bit Key Old Right Half Blocking Expansion The 32-Bit Right Half of The Input Block is Copied Into the Left Half of The Output Block The 32-Bit Right Half of The Input Block is Then Expanded to 48-Bits Original Right Half is Copied to New Left Half Old Right Half
64-Bit Block of Original Text 56-Bit Key 32-Bit Right Half 48-Bit ExpandedRight Half 48-Bit SubKey Old Right Half Anatomy of DES Blocking Permutation Expansion The 56-Bit Session Key is Further Reduced to a 48-Bit SubKey Original Right Half is Copied to New Left Half
Anatomy of DES The Input is Shifted Into the S-Registers in 6-bit groups. S1 S2 S3 S4 S5 S6 S7 S8 Inside Each Register, 2-bits are Used as Control Bits, and 4-bits as Data A Substitution Table is Used Inside Each Register to Calculate Its Output The S-Registers Perform Substitution and Compaction, Converting the 48-Bit Block to 32-Bits
1 0 1 1 0 1 1 2 3 4 S-Register Control Right (CR) Control Left (CL) 1 0 1 1 CL CR 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7 0 1 0 15 7 4 14 2 13 1 10 6 12 11 4 5 3 8 1 0 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0 1 1 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13 { { Example: S(1, 0, 1, 1, 1, 0) = (1, 0, 1, 1) 7 11 Anatomy of DES For Each of the Four Choices of the Two “Control Bits” , the S-register Performs a Different Substitution on the Half-byte Values of the Four “Input Bits”
64-Bit Block of Original Text 56-Bit Key 32-Bit Right Half 48-Bit ExpandedRight Half 48-Bit SubKey S5 S6 S7 S8 S1 S2 S3 S4 New Right Half Old Right Half Old Left Half New Right Half Anatomy of DES Blocking Permutation Expansion Substitution and Compaction Permutation Original Right Half is Copied to New Left Half
Anatomy of DES New 64-Bit Block 64-Bit Block of Original Text 56-Bit Key Blocking 32-Bit Right Half Permutation Expansion 48-Bit ExpandedRight Half 48-Bit SubKey Substitution and Compaction Permutation Original Right Half is Copied to New Left Half S5 S6 S7 S8 S1 S2 S3 S4 New Right Half New 64-Bit Block (To Next Round)
Encrypted Data %4Jb3xy Encrypted Data vG$uvbpA Key #2 Key #1 Key #1 or #3 Triple Des Algorithm (TDES) CryptoText Message E%f2$Uz7@W DES Decrypt DES Encrypt DES Encrypt Debit $500 • Implements 3 Successive Iterations of DES • Uses Two or Three 56-Bit Keys (112-bit or 168-bit)
Encryption Algorithms • Strengthening Encryption Algorithms • Strength of an Algorithm Measures How Long It Would Take an Adversary to Deduce the Key • The More Difficult the Mathematics, the Stronger the Algorithm • The Longer the Key, the Stronger the Algorithm • The More Often the Key Is Changed, the Stronger the Security • The Stronger the Algorithm, the Slower it Usually is Due to the Mathematical Overhead Required
Asymmetric Cryptography Most commonly known as Public Key Cryptography
End User Token Private Key Public Key X.509 Directory 1. Key Generation • Key pair is use in public key cryptography • Key generation provides the basis for trust • Private key protected and never shared • Public key bound in certificate and shared Key Pair Generation Certification Authority User Name Organization Location Digital Certificate
2. Digital Signature A Digital Signature Is a Special Block That is Appended to an Electronic Message. Allows for Verification of the AUTHENTICATION of the Sender and of the INTEGRITY of the content of an Electronic Message. Only Public-key Techniques Can Provide This. Stock Purchase Order Signature Block
Dear Sir, Please Send Me The Widget. Please Charge VISA Card 4123... A Alice’s Private Key Alice 2. Digital Signature How Alice Creates A Digital Signature Secure Hash Algorithm
A Message Digest(160 bits) Alice’s Private Key Alice Encrypt Signature Digital Signature 2. Digital Signature Dear Sir, Please Send Me The Widget. Please Charge VISA Card 4123... How Alice Creates A Digital Signature Secure Hash Algorithm
This is plain text. It can be a document, image, or any other data file This is plain text. It can be a document, image, or any other data file 2. Digital Signature Sender’s Certificate Sender’s Token • Sender uses private key to sign • Receiver uses sender’s public key to verify • Result is Pass or Fail Sender’s Private Key Sender’s Public Key Digitally Signed VERIFIED Sign Verify VERIFIED SENDER RECEIVER
Algorithms for Digital Signature • Digital Signature Algorithm (DSA) • Federal Standard (FIPS 186) • Secure Hash Algorithm (SHA-1) • Rivest Shamir Adleman (RSA) • Message Digest #5 (MD5) • Elliptic Curve Digital Signature Algorithm (ECDSA) c=me mod n m=cd mod n r=(gk mod p) mod q s=(k-1(H(m)+xr)) mod q
Digitized vs. Digital Signature A Digitized signature is a scanned image that can be pasted on any document A Digital Signature is a numeric value that is created by performing a cryptographic transformation of the data using the “signer’s” private key 1A56B29FF6310CD3926109F200D5EF71 9A274C66821B09AC3857FD62301AA27 00AB3758B6FE93DD Digital Signature Digitized Signature
Digital Certificates • Analogous to a Driver’s License or Employee Badge • Issued By Some Authority That Members Have in Common • Issued Under Some Set of Rules (Policies) • Document Issued Contains Public Information • Not Sensitive • Not Compromising • Provides Trust to Peers, Identification to Others
1. Message Encryption • Use token to generate a random message key • Encrypt message with symmetric algorithm (DES) Message Key Use RNG to GENERATE Sender’s Token 12A7BC544109FD00A6293FECC7293B9BCAA12020384AC6F4D93B8 This is plain text. It can be a document, image, or any other data file DES SENDER
Wrapped Message Key 2. Key Transport (Wrap) Sender’s Private Key Recipient’s Public Key • Encrypt message key with sender’s private key and recipient’s public key and a public key algorithm (RSA) Recipient’s Certificate Sender’s Token Message Key RSA (From previous step) SENDER
S/MIME, MSP 3. Compose Message • Send wrapped message key, encrypted message, and (optionally) sender’s certificate to recipient 12A7BC544109FD00A6293FECC7293B9BCAA12020384AC6F4D93B8 Encrypted Message Sender’s Certificate Wrapped Message Key SENDER
Sender’s Certificate Recipient’s Private Key Sender’s Public Key Recipient’s Token Wrapped Message Key Message Key 4. Key Transport (Unwrap) • Use the sender’s public key and the recipient’s private key to unwrap the message key with public key algorithm (RSA) RSA RECIPIENT
logg (x) Bob Alice gb ga gb mod p ga mod p Alternative Key Exchange MethodThe Diffie-Hellman Public Key System • Diffie-Hellman Works Because of a One-Way Function • The Function Is “Easy” to Compute but the Inverse Is “Hard” to Compute. • Specifically D-H Uses Discrete Exponents and Discrete Logs. (easy) (hard)
Message Key = 8 x 110 = 880 = 11 x 80 = 880 Diffie-Hellman • Return to the 3rd Grade... • Multiplication Is “Easy” and Division Is “Hard” • Diffie-Hellman Is Based on “X” and “/” • Bob and Alice Share a Generator (a) Value “10” Igor knows 10, 80 & 110 Division Required! Alice Bob 80 110 Secret = 11 Secret = 8 Public = 11 x 10 = 110 Public = 8 x 10 = 80
5. Message Decryption • Use unwrapped (RSA) or computed shared (D-H) message key to decrypt the data using a symmetric algorithm (e.g., DES) Message Key 12A7BC544109FD00A6293FECC7293B9BCAA12020384AC6F4D93B8 DES This is plain text. It can be a document, image, or any other data file RECIPIENT
Basic Key Recovery This is a critical note on our 1999 revenue ... $):”<(%$%&(@?<:”^%:)(*&%@#%(*^$+#@ Encrypted Data KRF Key Recovery Field Message Key Public Key KEY RECOVERY AGENT Private Key KRF
Using Security Services • Digital Signatures • Client Authentication on a Web Server • Netscape, Microsoft • Compared to Access Control List on Server • Server Authentication on a Web Client • Netscape, Microsoft • Stops Man-in-the-middle Attack • Message Authentication • S/MIME E-mail Message • Netscape, MS Outlook Express 98 • Audit • Authentication of User Provides Non-repudiation of Client Access • May Provide Legal Proof for Later Arbitration
Using Security Services • Confidentiality • Link Encryption • IPSec (Layers 2/3) • Secure tunnel between VPN boxes • SSL (Layers 4/5) • Secure “tunnel” to web server • Netscape, Microsoft • FTP (Layers 6/7) • Secure file transfer
User Info + X.509 Public Key Digital Certificates • Certification Authority acts as a trusted third party: • Binds user information to public key. • Issues an unforgeable certificate. • Digital certificate can be published in a public directory/repository. • Digital certificate can be used to provide the required security services: integrity, confidentiality, authentication, authorization, and non-repudiation. • ITU Recommendation X.509 is the accepted standard for digital certificates in Government and industry. Certification Authority Digital Certificate
X.509 Certificates (cont.) • X.509 Version 3 certificates: • Defined extensions that can be added to the base certificate: • public key information • policy information • additional subject attribute information • constraint information • CRL information • Widely accepted in Gov’t and industry. • Commercial and Gov’t implementations.