1 encryption conventional encryption message confidentiality ola flygt växjö university, sweden ...

48
1 Encryption Encryption Conventional Conventional Encryption Encryption Message Message Confidentiality Confidentiality Ola Flygt Växjö University, Sweden http://w3.msi.vxu.se/users/ofl/ [email protected] +46 470 70 86 49

Upload: linette-cole

Post on 04-Jan-2016

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

1

EncryptionEncryptionConventional Conventional Encryption Encryption Message Message

ConfidentialityConfidentialityOla FlygtVäxjö University, Sweden

http://w3.msi.vxu.se/users/ofl/[email protected]

+46 470 70 86 49

Page 2: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

2

OutlineOutline

Conventional Encryption PrinciplesConventional Encryption AlgorithmsCipher Block Modes of OperationLocation of Encryption DevicesKey Distribution

Page 3: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

3

Conventional Encryption Conventional Encryption PrinciplesPrinciples

An encryption scheme has five ingredients:PlaintextEncryption algorithmSecret KeyCiphertextDecryption algorithm

Page 4: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

4

Conventional Encryption Conventional Encryption PrinciplesPrinciples

Page 5: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

5

Requirements for Requirements for SecuritySecurity

Strong encryption algorithmEven if known, should not be able to

decrypt or work out keyEven if a number of cipher texts are

available together with plain texts of them

Sender and receiver must obtain secret key securely

Once key is known, all communication using this key is readable

Page 6: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

6

CryptographyCryptography

Classified along three independent dimensions:The type of operations used for

transforming plaintext to ciphertextThe number of keys used

symmetric (single key)asymmetric (two-keys, or public-key

encryption)

The way in which the plaintext is processed

Page 7: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

7

Average time required Average time required for exhaustive key for exhaustive key

search search Key Size (bits)

Number of Alternative Keys

Time required at 106 Decryption/µs

32 232 = 4.3 x 109 2.15 milliseconds

56 256 = 7.2 x 1016 10 hours

128 2128 = 3.4 x 1038 5.4 x 1018 years

168 2168 = 3.7 x 1050 5.9 x 1030 years

Page 8: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

8

Classical Encryption Classical Encryption TechniquesTechniques

Substitution Techniques : plaintext are replaced by other letters or by numbers or symbols Caesar Cipher

Monoalphabetic Cipher

Playfair Cipher

Polyalphabetic Cipher Transposition Techniques : some sort of

permutation on the plaintext letters

Page 9: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

9

Caesar CipherCaesar Cipher

Replacing each other letter of the alphabet with the letter standing three places further down - plain : meet me after the toga party - cipher : PHHW PH DIWHU WKH WRJD SDUWB

Note that the alphabet is wrapped around, so that the letter following Z is A. - plain : abcdefghijklmnopqrstuvwxyz - cipher : DEFGHIJKLMNOPQRSTUVWXYZABC

If we assign a numerical equivalent to each letter(a=1, b=2 etc) - C = E(p) = (p+3) mod (26) - P = D(c) = (c–3) mod (26)

Page 10: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

10

Crypto analysis of the Crypto analysis of the Caesar CipherCaesar Cipher

brute-force cryptanalysis Simply try all the 25 possible keys.

Three important characteristic of this problem:1. The encryption/decryption algorithm

are known2. There are only 25 keys to try3. The language of the plaintext is known

and easily recognized

Page 11: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

11

Monoalphabetic CipherMonoalphabetic Cipher

Cipher line can be any permutation of the 26 alphabetic characters 26! Or greater than 4*1026 possible keys If an enemy agent could check one of these possible

keys every second, it would take roughly one billion times the lifetime of the universe to check all of them and find the correct one.This simple brute force approach clearly will not work.

http://www.simonsingh.net/The_Black_Chamber/generalsubstitutionWithMenu.html

Page 12: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

12

Crypto analysis of the Crypto analysis of the Monoalphabetic CipherMonoalphabetic Cipher

Attack : regularities of the language

Page 13: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

13

Polyalphabetic CipherPolyalphabetic Cipher

Instead of having one key (table) that is used to encrypt each block of plaintext, we use several different keys.

The Vigenère cipher is the classical example.

http://www.simonsingh.net/The_Black_Chamber/Swapping_Cipher_Alphabets.html

Page 14: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

14

One time padOne time pad

Messagesn-bit strings [b1,…,bn]

KeysRandom n-bit strings [k1,…,kn]

Encryption/Decryptionc = E(b, k) = b k = [b1 k1, …, bn kn]

denotes exclusive or

b = D(b, k) = c k = b k k = b [1, …, 1] = b

Page 15: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

15

One time pad (cont.)One time pad (cont.)

PropertiesProvably unbreakable if used

properlyKeys must be truly randomMust not be used more than onceKey same size as message

Page 16: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

16

Transposition ciphersTransposition ciphers

An alternative to substitution ciphers

Instead of changing the coding of the characters (blocks) in the plaintext, we rearrange the text.

The effect is that the cipher text and the plaintext contains the same symbols.

Page 17: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

17

Simple permutationSimple permutation

AlgorithmDivide to plaintext into blocksDecide on a permutation orderRearrange the blocks according to this

Example:Plaintext: We a|re t|he b|est!Key: 1 4 2 3Cipher text: Wae |rte |hbe |e!st

Page 18: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

18

Transposition ciphersTransposition ciphers

A more complex transposition cipher is to write the message in a rectangle, row by row, and read the message off, column by column but permute the order of the columns K e y : 4 3 1 2 5 6 7

Input : t h e e x a m

p l e j u s t

g i v e n s u

g g e s t s t

h a t m u l t

Ciphertext EEVETEJESMHLIGATPGGHXUNTUASSSLMTUTT

Page 19: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

19

Problems with Problems with classical ciphersclassical ciphers

Neither substitution nor transposition ciphers are secure enough today.

They also often have problems with complex keys that are hard to remember.

Solution?

Page 20: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

20

Product ciphersProduct ciphers

Combine both methods!Simple ciphers can be

implemeted in hardwareS-box = substition cipherP-box transposition cipher

Page 21: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

21

Feistel Cipher StructureFeistel Cipher Structure

Virtually all conventional block encryption algorithms, including DES have a structure first described by Horst Feistel of IBM in 1973

The realization of a Fesitel Network depends on the choice of the following parameters and design features (see next slide):

Page 22: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

22

Feistel Cipher StructureFeistel Cipher StructureBlock size: larger block sizes mean greater

securityKey Size: larger key size means greater

securityNumber of rounds: multiple rounds offer

increasing securitySubkey generation algorithm: greater

complexity will lead to greater difficulty of cryptanalysis.

Fast software encryption/decryption: the speed of execution of the algorithm becomes a concern

Page 23: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

23

Page 24: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

24

Conventional Encryption Conventional Encryption AlgorithmsAlgorithms

Data Encryption Standard (DES)The most widely used encryption

schemeThe algorithm is reffered to the Data

Encryption Algorithm (DEA)DES is a block cipherThe plaintext is processed in 64-bit

blocksThe key is 56-bits in length

Page 25: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

25

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

General description of DESGeneral description of DES

Page 26: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

26

Page 27: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

27

DESDES

The overall processing at each iteration:Li = Ri-1

Ri = Li-1 F(Ri-1, Ki)Concerns about:

The algorithm and the key length (56-bits)

Page 28: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

28

Time to break a code (10Time to break a code (1066 decryptions/µs)decryptions/µs)

Page 29: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

29

Problem with DESProblem with DES

Broken in 1998 by Electronic Frontier FoundationUsed special purpose machine -

$250,000Took less than three daysDES IS NOT WORTHLESS!!!!

Page 30: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

30

Triple DEATriple DEA

Use three keys and three executions of the DES algorithm (encrypt-decrypt-encrypt)

C = ciphertext P = Plaintext EK[X] = encryption of X using key K DK[Y] = decryption of Y using key K

Effective key length of 168 bits

C = EK3[DK2[EK1[P]]]

Page 31: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

31

Triple DEATriple DEA

Page 32: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

32

Other Symmetric Block Other Symmetric Block CiphersCiphers

International Data Encryption Algorithm (IDEA)128-bit keyUsed in PGP

BlowfishEasy to implementHigh execution speed Run in less than 5K of memory

Page 33: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

33

Other Symmetric Block Other Symmetric Block CiphersCiphers

RC5Suitable for hardware and softwareFast, simpleAdaptable to processors of different word lengthsVariable number of roundsVariable-length keyLow memory requirementHigh securityData-dependent rotations

Cast-128Key size from 40 to 128 bitsThe round function differs from round to round

Page 34: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

34

Advanced Encryption Advanced Encryption Standard (AES)Standard (AES)

National Institute of Standards and Technology (NIST) in 1997 issued call for Advanced Encryption Standard (AES)Security strength equal to or better than

3DESImproved efficiencySymmetric block cipherBlock length 128 bitsKey lengths 128, 192, and 256 bits

Page 35: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

35

AESAESEvaluation included security,

computational efficiency, memory requirements, hardware and software suitability, and flexibility

The selected cipher was developed by two Belgian cryptographers, Joan Daemen and Vincent Rijmen, and submitted to the AES selection process under the name "Rijndael"

2001, AES issued as federal informationprocessing standard (FIPS 197)

Page 36: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

36

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 37: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

37

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 38: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

38

Comparison tableComparison table

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 39: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

39

Cipher Block Modes of Cipher Block Modes of OperationOperation

Electronic Code Book (ECB) Mode

Cipher Block Chaining (CBC) Mode

Cipher Feedback (CFB) Mode

Page 40: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

40

Electronic Code Book Electronic Code Book (ECB) Mode(ECB) Mode

Block 1 Block 2 Block 3 Block 4 Block 5 …

E(block) E(block) E(block) E(block) E(block) E(block)

Block 1 Block 2 Block 3 Block 4 Block 5 …

Plaintext

Ciphertext

• Pad last block, if necessary

Block Encryption

Page 41: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

41

Cipher Block Chaining Cipher Block Chaining ModeMode

The input to the encryption algorithm is the XOR of the current plaintext block and the preceding ciphertext block.

Repeating pattern of 64-bits are not exposed

Page 42: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

42

Cipher Block Chaining Cipher Block Chaining ModeMode

Page 43: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

43

Cipher Feedback Cipher Feedback ModeMode

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

Page 44: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

44

Location of Encryption Location of Encryption DeviceDevice

Link encryption:A lot of encryption devicesHigh level of securityDecrypt each packet at every switch

End-to-end encryptionThe source encrypt and the receiver

decryptsPayload encryptedHeader in the clear

High Security: Both link and end-to-end encryption are needed

Page 45: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

45

Page 46: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

46

Key DistributionKey Distribution

1. A key could be selected by A and physically delivered to B.

2. A third party could select the key and physically deliver it to A and B.

3. If A and B have previously used a key, one party could transmit the new key to the other, encrypted using the old key.

4. If A and B each have an encrypted connection to a third party C, C could deliver a key on the encrypted links to A and B.

Page 47: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

47

Key DistributionKey DistributionSession key:

Data encrypted with a one-time session key. At the conclusion of the session the key is destroyed.

Permanent key:Used between entities for the purpose of

distributing session keys.

Page 48: 1 Encryption Conventional Encryption Message Confidentiality Ola Flygt Växjö University, Sweden  Ola.Flygt@msi.vxu.se +46

48