cryptography (continued). enabling alice and bob to communicate securely m m m alice eve bob m

26
Cryptography (continued)

Post on 20-Dec-2015

224 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Cryptography (continued)

Page 2: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Enabling Alice and Bob to Communicate Securely

m

m

m

Alice

Eve

Bob

m

Page 3: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Kerckhoff’s Principle

• Bob needs two things to decrypt the ciphertext – the decryption algorithm and the key

• The security of the encryption method depends only on the secret of the key, not on the security of the algorithm(s)– Algorithms are hard to change whereas key are not– Protects the longevity of the algorithm– If the cryptographic systems is built for multiple (millions

of) users everyone uses the same algorithm but different keys

• Public algorithms are amenable to more robust testing

• Moral – Don’t trust proprietary crypto systems

Page 4: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Four Issues

• Confidentiality• Authentication• Integrity• Non-repudiation

Page 5: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Confidentiality

• Assures that encrypted files can only be decrypted by those who hold the secret key

• What’s missing?– Who is on the other end of the line?– Has the file you received been

tampered with?

Page 6: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Authentication

• Who is on the other end?• Challenge response

1) Pick a random number2) Challenge the computer sending you a

message to encrypt it using the secret key

3) If successful, authentication has occurred

• Note re. the randomness of random numbers

Page 7: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Integrity

• Also known as message authentication and digital fingerprinting

• Message Authentication Codes (MACs)– Use a hashing algorithm– Use one way compression so for example

a 50MB document produces a 8B MAC– Avalanche effect

Page 8: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Non-repudiation

• Assurance that a sender cannot deny a file was sent

• Not possible with a shared secret key

Page 9: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Some Attacks

• Ciphertext only• Known plaintext• Chosen plaintext• Chosen ciphertext• Birthday and Meet in the Middle

attacks

Page 10: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Block Ciphers

• An encryption function for fixed sized blocks (today 128 bits). Blocks are split into words, usually 32 bits

• Common key sizes – 128 and 256 bits• Algorithms consist of multiple rounds

of operations on words, e.g. Boolean operations AND, XOR, NOT

Page 11: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Block Cipher Examples

• DES – 64 bit block size, 56 bit key• AES – NIST RFP from Crypto

community. Winner was Rijndael• Twofish – AES finalist• Serpent – AES finalist• All support 128, 192, and 156 bit

keys. Larger than 128 bits is necessary to avoid collision attacks.

Page 12: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Hashing

• A hash uses a secret key and an algorithm to create a new value from a message of a fixed size. Also known as a message digest.

• Should be a one way function. • Should have collision resistance.

Page 13: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Hashing Example

• Example – key = 194, plain text = 45678, Multiply 45678 by 194 = 8861532, Reverse the number = 2351688, Take the 5 most significant digits = 23516

• Send the hash (23516) along with the message (45678)

Page 14: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Secret Key Exchange

• Distribution and escrow• Vulnerability of a trusted 3rd party

Page 15: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Public Exchange of Secret Keys

• Exchange a file of (key, serial #) pairs1) Pick one2) Send serial number3) Use associated key to encrypt and decrypt

• Encrypt the file using a single key and a known algorithm

1) Decrypt the file2) Pick a pair3) Send serial #4) Use associated key to encrypt and decrypt

Page 16: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Public Exchange of Secret Keys (cont.)

• Encrypt each pair in the file separately

1) Pick a pair and decrypt it2) Send the serial #3) Use the associated key to encrypt

and decrypt

Page 17: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Asymmetric Ciphers (e.g. Diffie-Hellman)

• Keys for encryption and decryption are different, but related

• A key made publicly is shared• How does it work?

Page 18: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Public Key Encryption Math

• Inverse operations• Inverse numbers• Circle analogy• Modular arithmetic• Primes and relative primes

Page 19: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

PK Math

1) Pick p and q that are relatively prime

2) n = p*q 3) Find d and e where d*e = (p-1)(q-

1)+1 4) The receiver makes n and e public 5) Encryption me mod n = c 6) Decryption cd mod n = m

Page 20: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

PK Example

1) p = 17, q = 5, n = 852) d * e = (17 – 1)(5 – 1) + 1 = 65, d

= 13, e = 53) Encrypt the letter x, x = 24

Page 21: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

PGP

• Developed by Phil Zimmerman• Used RSA patented algorithms to

produce freeware strong encryption

• Copied widely around the world• MIT published PGP code and made

it available on their websites

Page 22: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Steganography

• Steganography means hidden writing

• Hiding a message in an image• Ancient technique

Page 23: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Steganography

• Steganography - hiding a message in an image or a sound file

• Every image is made of pixels• There often is one byte per pixel for each

color: red, green, and blue• One bit in each byte is the least

significant—changing it will be indistinguishable to the human eye

Page 24: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Uses of Steganography

• Al-Qaida• Digital Watermarking

• Using steganography to hide identifying information in a document

• To prove copyright ownership

• To identify different copies of a document

Page 25: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Replay Attacks

• Replay Attacks– Retransmit an intercepted message– Message is encrypted so that replay

attacker cannot read it

• Why Replay Attacks– Repetition might work—for instance,

replaying an encrypted username and password might result in access to a poorly designed system

Page 26: Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m

Replay Attacks

• Preventing Replay Attacks

– Insert a time stamp in messages and accept messages only if they are very recent

– Insert a sequence number in each message

– Insert a nonce (random number selected for the occasion) in a request message; only accept a reply message with the same nonce. Other party does not accept a request message with a previous nonce