Computer Security: Principles and Practice W Stallings, L Brown Some slides by Dr Lincke Chapter 2 Encryption Slideshow and powerpoint viewer: Encryption Text: Computer Security: Principles an

Encryption Text: Computer Security: Principles and Practice, W Stallings, L Brown Chapter 2 Objectives: The student should be able to: Define authentication, integrity, confidentiality and non-repudiation. Define plaintext, ciphertext, key, P-box, S-box, session key, digital signature, message digest, hash. Demonstrate operation of a simple substitution cipher, permutation cipher, stream cipher, block cipher, block chaining mode cipher. Describe why chaining is advantageous in block ciphers. Define symmetric versus asymmetric encryption algorithms and describe the differences between the two. Define the advantages of secret key and public key algorithms. Describe their functions in relation to authenticity, non-repudiation, integrity, confidentiality, and speed. Describe two methods of producing a hash. Define whether the following protocols support authentication, non-repudiation, integrity, and/or confidentiality via hashing or a type of encryption: AES, HMAC, DES, MD5, RCS, RSA.

Cryptographic Tools cryptographic algorithms important element in security services review various types of elements symmetric encryption public-key (asymmetric) encryption digital signatures and key management secure hash functions example is use to encrypt stored data

Data Privacy Confidentiality: Unauthorized parties cannot access information (->Secret Key Encryption Authenticity: Ensuring that the actual sender is the claimed sender. (->Public Key Encryption) Integrity: Ensuring that the message was not modified in transmission. (->Hashing) Nonrepudiation: Ensuring that sender cannot deny sending a message at a later time. (->Digital Signature) Bill Confidentiality Joe Bill Authenticity Joe (Actually Bill) Ann Integrity Joe Bill Ann Non-Repudiation Joe Ann Ann

Encryption Stages Substitution Gsv hrav lu gsv vmxrksvivw gvcg hslfow yv m l ozitvi gszm gs v gvcg lu gsv lirtr m z o n v h h z t v. Permutation M Y K E Y T H E C A S H I S S T O R E D I N A C C O U N T 1 2 5 9 6 N A M E A L CSECT6A EIRAN9E TSTIO2A HHONU5M ASDC1NL

Electronic Codebook (ECB) simplest mode split plaintext into blocks encrypt each block using the same key “codebook” because have unique ciphertext value for each plaintext block not secure for long messages since repeated plaintext is seen in repeated ciphertext

Block Cipher Structure have a general iterative block cipher structure with a sequence of rounds with substitutions / permutations controlled by key parameters and design features: block size key size number of rounds subkey generation algorithm round function complexity also: fast software en/decrypt, ease of analysis

Commercial Block Ciphers Key Size #Functions Block Size DES 64 bits (w. 8 bit parity) 16 64-bit 1999: Distributed net cracked DES key in 22 hours Triple DES 3DES 2 x 64 or 3 x 64 48 64-bit E.g.: DES-EEE3, DES-EDE2 Compared to DES: - 256 times stronger - 3 times more time-consuming IDEA 128 8 64-bit Uses: PGP encryption 16 64-bit Thought to be more reliable than AES (2001) 32-, 64- or 128-bit Patented by RSA Data Security. Blowfish to 448 bits RCS to 2048 bits Variable AES 128*, 192, 256 Variable:1 0* 12, 14 Comments 128-bit* or Uses: HTTPS variable Current govt. standard for sensitive but unclassified info.

DES and Triple-DES Data Encryption Standard (DES) is the most widely used encryption scheme uses 64 bit plaintext block and 56 bit key to produce a 64 bit ciphertext block concerns about algorithm & use of 56-bit key Triple-DES repeats basic DES algorithm three times using either two or three unique keys much more secure but also much slower

Triple DES (3DES) first used in financial applications in DES FIPS PUB 46-3 standard of 1999 uses three keys & three DES executions: C = E(K3, D(K2, E(K1, P))) decryption same with keys reversed use of decryption in second stage gives compatibility with original DES users effective 168-bit key length, slow, secure AES will eventually replace 3DES

Advanced Encryption Standard (AES) needed a better replacement for DES NIST called for proposals in 1997 selected Rijndael in Nov 2001 published as FIPS 197 symmetric block cipher uses 128 bit data & 128/192/256 bit keys now widely available commercially

Stream Ciphers processes input elements continuously key input to a pseudorandom bit generator produces stream of random like numbers unpredictable without knowing input key XOR keystream output with plaintext bytes are faster and use far less code design considerations: encryption sequence should have a large period keystream approximates random number properties uses a sufficiently long key

Attacking Symmetric Encryption cryptanalysis rely on nature of the algorithm plus some knowledge of plaintext characteristics even some sample plaintext-ciphertext pairs exploits characteristics of algorithm to deduce specific plaintext or key brute-force attack try all possible keys on some ciphertext until get an intelligible translation into plaintext

Public Key Requirements 1. 2. 3. 4. 5. 6. computationally easy to create key pairs computationally easy for sender knowing public key to encrypt messages computationally easy for receiver knowing private key to decrypt ciphertext computationally infeasible for opponent to determine private key from public key computationally infeasible for opponent to otherwise recover original message useful if either key can be used for each role

Public Key Algorithms RSA (Rivest, Shamir, Adleman) Diffie-Hellman key exchange algorithm only allows exchange of a secret key Digital Signature Standard (DSS) developed in 1977 only widely accepted public-key encryption alg given tech advances need 1024+ bit keys provides only a digital signature function with SHA-1 Elliptic curve cryptography (ECC) new, security like RSA, but with much smaller keys

Encryption Comparison Secret Key: Block Ciphers Secret Key: Stream Cipher Public Key Medium Processing Light Processing, Short code Intensive Processing Shared key Shared key Unshared key Block encryption improved with chained key Requires good pseudorandom # generator Keys pairs are related via complex math Uses: Confidentiality: Session Encryption Uses: Confidentiality: Session Encryption Uses: Short encryption, Authentication, Nonrepudiation Files, database, large blocks of data Data communications: streams Key management, Digital signature

Documents with Integrity Questions Can fraud occur if changes are made? Was this document modified? How can I be sure you sent it? Is encryption necessary? Data Applications Integrity Contracts Financial data Non-Repudiation Digital Signature Contracts Check Sum

Message Authentication protects against active attacks verifies received message is authentic contents unaltered from authentic source timely and in correct sequence may use conventional encryption only sender & receiver have key needed or separate authentication mechanisms append authentication tag to cleartext message

Simple Hash Functions a one-way or secure hash function used in message authentication, digital signatures all hash functions process input a block at a time in an iterative fashion one of simplest hash functions is the bitby-bit exclusive-OR (XOR) of each block Ci = bi1 bi2 . . . bim effective data integrity check on random data less effective on more predictable data virtually useless for data security

Secure Hash Functions Message Message H Message H H Compare K H H Message Authentication Code Message H Message H K K Message K H Message H E H K One Way Hash Message H H D K Message H H Compare H H Compare H H H

Hash Function Requirements applied to any size data H produces a fixed-length output. H(x) is relatively easy to compute for any given x one-way property weak collision resistance computationally infeasible to find x such that H(x) = h computationally infeasible to find y ≠ x such that H(y) = H(x) strong collision resistance computationally infeasible to find any pair (x, y) such that H(x) = H(y)

Random Numbers random numbers have a range of uses requirements: randomness based on statistical tests for uniform distribution and independence unpredictability successive values not related to previous clearly true for truly random numbers but more commonly use generator

Pseudorandom verses Random Numbers often use algorithmic technique to create pseudorandom numbers which satisfy statistical randomness tests but likely to be predictable true random number generators use a nondeterministic source e.g. radiation, gas discharge, leaky capacitors increasingly provided on modern processors

Link versus End-to-End Encryption Use when LINK is vulnerable: Packet sniffers & eavesdroppers Use when Intermediate nodes may be compromised Link-Specific: All packets transmitted on the single link are encrypted Connection-Specific: A connection is encrypted across all its links Encrypted for all protocol layers (at or above encryption layer) Encrypted for upper layer protocols only Intermediate nodes decrypt Intermediate nodes cannot decrypt Provides node authentication Provides user authentication Transparent to user: One key per link Not user-transparent: One key per connection One algorithm for all users User selects encryption algorithm Encryption done in hardware Encryption done in hardware or software Virtual Private Network (VPN) Wireless: (WEP, WPA, WPA2) IP Security (IPsec) Secure Shell (SSH) Secure Socket Layer (TSL, SSL) IP Security (IPsec)