Η παρουσίαση φορτώνεται. Παρακαλείστε να περιμένετε

Η παρουσίαση φορτώνεται. Παρακαλείστε να περιμένετε

Cryptography and Network Security Chapter 3

Παρόμοιες παρουσιάσεις


Παρουσίαση με θέμα: "Cryptography and Network Security Chapter 3"— Μεταγράφημα παρουσίασης:

1 Cryptography and Network Security Chapter 3
Fifth Edition by William Stallings Lecture slides by Lawrie Brown for “Cryptography and Network Security”, 5/e, by William Stallings, Chapter 3 – “Block Ciphers and the Data Encryption Standard”.

2 Κρυπτογραφικοι Αλγοριθμοι Τμηματων (Block Ciphers)
All the afternoon Mungo had been working on Stern's code, principally with the aid of the latest messages which he had copied down at the Nevin Square drop. Stern was very confident. He must be well aware London Central knew about that drop. It was obvious that they didn't care how often Mungo read their messages, so confident were they in the impenetrability of the code. —Talking to Strange Men, Ruth Rendell Intro quote.

3 Συγχρονοι αλγοριθμοι Τμηματων
Ας δουμε τωρα τους συγχρονους κρυπτογραφικους αλγοριθμους Οι αλγοριθμοι τμηματων ειναι απο τους πιο ευρεως χρησιμοποιουμενους τυπους κρυπτογραφικων αλγοριθμων. Χρησιμοποιουνται για τις υπηρεσιες τοσο της μυστικοτητας, οσο και της πιστοποιησης αυθεντικοτητας Θα εστιασουμε στον αλγοριθμο DES (Data Encryption Standard) προκειμενου να μελετησουμε τις σχεδιαστικες αρχες των αλγοριθμων τμηματων. The objective of this chapter is to illustrate the principles of modern symmetric ciphers. For this purpose, we focus on the most widely used symmetric cipher: the Data Encryption Standard (DES). Although numerous symmetric ciphers have been developed since the introduction of DES, and although it is destined to be replaced by the Advanced Encryption Standard (AES), DES remains the most important such algorithm. Further, a detailed study of DES provides an understanding of the principles used in other symmetric ciphers. This chapter begins with a discussion of the general principles of symmetric block ciphers. Next, we cover full DES. Following this look at a specific algorithm, we return to a more general discussion of block cipher design.

4 Αλγοριθμοι τμηματων (Βlock Ciphers) και Αλγοριθμοι Ροης (Stream Ciphers)
Οι αλγοριθμοι ροης, οταν κρυπτογραφουν ή αποκρυπτογραφουν επεξεργαζονται ενα μονο bit ή byte καθε φορα. Πολλοι συγχρονοι αλγοριθμοι κρυπτογραφησης ειναι αλγοριθμοι τμηματων. Αναλυονται καλυτερα Εχουν ευρυτερο πεδιο εφαρμογων Block ciphers work a on block / word at a time, which is some number of bits. All of these bits have to be available before the block can be processed. Stream ciphers work on a bit or byte of the message at a time, hence process it as a “stream”. Block ciphers are currently better analysed, and seem to have a broader range of applications, hence focus on them.

5 Block vs Stream Ciphers
A block cipher is one in which a block of plaintext is treated as a whole and used to produce a ciphertext block of equal length. Typically, a block size of 64 or 128 bits is used. As with a stream cipher, the two users share a symmetric encryption key (Figure 3.1b). A stream cipher is one that encrypts a digital data stream one bit or one byte at a time. In the ideal case, a one-time pad version of the Vernam cipher would be used (Figure 2.7), in which the keystream (k ) is as long as the plaintext bit stream (p).

6 Αρχες των Αλγοριθμων Τμηματων
Οι περισσοτεροι συμμετρικοι αλγοριθμοι τμηματων βασιζονται σε δομη Feistel Cipher Αποκρυπτογραφουν το ciphertext αποδοτικα Μπορουν να ειδωθουν ως μια εξαιρετικα μεγαλη αντικατασταση. Θα χρειαζονταν ομως εναν πινακα με 264 entries για μια δεσμη των 64-bits Aποτελουνται απο μικροτερα δομικα στοιχεια και χρησιμοποιουν την ιδεα του product cipher Most symmetric block encryption algorithms in current use are based on a structure referred to as a Feistel block cipher. A block cipher operates on a plaintext block of n bits to produce a ciphertext block of n bits. An arbitrary reversible substitution cipher for a large block size is not practical, however, from an implementation and performance point of view. In general, for an n-bit general substitution block cipher, the size of the key is n x 2n. For a 64-bit block, which is a desirable length to thwart statistical attacks, the key size is 64x 264 = 270 = 1021 bits. In considering these difficulties, Feistel points out that what is needed is an approximation to the ideal block cipher system for large n, built up out of components that are easily realizable.

7 Data Encryption Standard (DES)
Κρυπτογραφει δεδομενα των 64-bit χρησιμοποιωντας κλειδι των 56-bits H ασφαλεια του εχει αμφισβητηθει The most widely used private key block cipher, is the Data Encryption Standard (DES). It was adopted in 1977 by the National Bureau of Standards as Federal Information Processing Standard 46 (FIPS PUB 46). DES encrypts data in 64-bit blocks using a 56-bit key. The DES enjoys widespread use. It has also been the subject of much controversy its security.

8 Αμφισβητηση του σχεδιασμου του DES
Αν και το DES standard ειναι πασιγνωστο υπαρχει σημαντικη αμφισβητηση για το σχεδιασμο του. Για την επιλογη κλειδιου των 56-bit (εναντι 128-bit αλλων αλγοριθμων) Για το γεγονος οτι τα σχεδιαστικα του κριτηρια ειναι διαβαθμισμενα Ωστοσο μεταγενεστερα γεγονοτα και αναλυσεις δειχνουν οτι τελικα ο σχεδιασμος του DES ηταν σωστος Before its adoption as a standard, the proposed DES was subjected to intense & continuing criticism over the size of its key & the classified design criteria. Recent analysis has shown despite this controversy, that DES is well designed. DES is theoretically broken using Differential or Linear Cryptanalysis but in practise is unlikely to be a problem yet. Also rapid advances in computing speed though have rendered the 56 bit key susceptible to exhaustive key search, as predicted by Diffie & Hellman. DES has flourished and is widely used, especially in financial applications. It is still standardized for legacy systems, with either AES or triple DES for new applications.

9 Κρυπτογραφηση DES The overall scheme for DES encryption is illustrated in Stallings Figure 3.4, which takes as input 64-bits of data and of key. The left side shows the basic process for enciphering a 64-bit data block which consists of: - an initial permutation (IP) which shuffles the 64-bit input block - 16 rounds of a complex key dependent round function involving substitutions & permutations - a final permutation, being the inverse of IP The right side shows the handling of the 56-bit key and consists of: - an initial permutation of the key (PC1) which selects 56-bits out of the 64-bits input, in two 28-bit halves - 16 stages to generate the 48-bit subkeys using a left circular shift and a permutation of the two 28-bit halves

10 Δομη του γυρου DES Χρησιμοποιει δυο μισα (Left & Right, L&R) των 32-bits. Oποιοσδηποτε Feistel cipher μπορει να περιγραφει ως εξης: Li = Ri–1 Ri = Li–1  F(Ri–1, Ki) Η F παιρνει το δεξι μισο των 32-bits (R) και το υποκλειδι των 48-bits: Eπεκτεινεται το R στα 48-bits χρησιμοποιωντας τη μεταθεση Ε Στη συνεχεια γινεται ΧOR με το υποκλειδι Οτι προκυπτει περναει μεσα απο 8 S-boxes και προκυπτει αποτελεσμα των 32-bits Tελικα πραγματοποιειται μεταθεση, χρησιμοποιωντας την 32-bit μεταθεση P We now review the internal structure of the DES round function F, which takes R half & subkey, and processes them. The round key Ki is 48 bits. The R input is 32 bits. This R input is first expanded to 48 bits by using a table that defines a permutation plus an expansion that involves duplication of 16 of the R bits (Table 3.2c). The resulting 48 bits are XORed with Ki This 48-bit result passes through a substitution function that produces a 32-bit output, which is permuted as defined by Table 3.2d. This follows the classic structure for a feistel cipher. Note that the s-boxes provide the “confusion” of data and key values, whilst the permutation P then spreads this as widely as possible, so each S-box output affects as many S-box inputs in the next round as possible, giving “diffusion”.

11 Δομη του γύρου DES (DES Round Structure)

12 Δομη του γύρου DES Υπολογισμος του F
Stallings Figure 3.7 illustrates the internal structure of the DES round function F. The R input is first expanded to 48 bits by using expansion table E that defines a permutation plus an expansion that involves duplication of 16 of the R bits (Stallings Table 3.2c). The resulting 48 bits are XORed with key Ki . This 48-bit result passes through a substitution function comprising 8 S-boxes which each map 6 input bits to 4 output bits, producing a 32-bit output, which is then permuted by permutation P as defined by Stallings Table 3.2d.

13 Κουτια Αντικαταστασης S (Substitution Boxes S)
Εχουμε 8 S-boxes που αντιστοιχουν καθε 6αδα bits σε μια 4αδα Kαθε S-box ειναι στην πραγματικοτητα 4 μικρα boxes των 4 bits. Τα εξωτερικα bits 1 & 6 (row bits) επιλεγουν μια γραμμη των 4 Τα εσωτερικα bits 2-5 (col bits) αντικαθιστανται Το αποτελεσμα ειναι 8 ομαδες των 4 bits, ή 32 bits Η επιλογη γραμμης εξαρταται τοσο απο τα δεδομενα, οσο και απο το κλειδι Το χαρακτηριστικο αυτο ονομαζεται autoclaving (autokeying) Παραδειγμα: S( d ) = 5fd25e03 The substitution consists of a set of eight S-boxes, each of which accepts 6 bits as input and produces 4 bits as output. These transformations are defined in Stallings Table 3.3, which is interpreted as follows: The first and last bits of the input to box Si form a 2-bit binary number to select one of four substitutions defined by the four rows in the table for Si. The middle four bits select one of the sixteen columns. The decimal value in the cell selected by the row and column is then converted to its 4-bit representation to produce the output. For example, in S1, for input , the row is 01 (row 1) and the column is 1100 (column 12). The value in row 1, column 12 is 9, so the output is 1001. The example lists 8 6-bit values (ie 18 in hex is in binary, 09 hex is binary, 12 hex is binary, 3d hex is binary etc), each of which is replaced following the process detailed above using the appropriate S-box. ie S1(011000) lookup row 00 col 1100 in S1 to get 5 S2(001001) lookup row 01 col 0100 in S2 to get 15 = f in hex S3(010010) lookup row 00 col 1001 in S3 to get 13 = d in hex S4(111101) lookup row 11 col 1110 in S4 to get 2 etc

14 Aποκρυπτογραφηση DES (DES Decryption)
Ακολουθειται ακριβως η αντιστροφη πορεια με τα βηματα της κρυπτογραφησης χρησιμοποιωντας τα υποκλειδια με αντιστροφη σειρα (SK16 … SK1) H αρχικη μεταθεση (IP) αναιρει το τελευταιo βημα (FP) της κρυπτογραφησης. Ο πρωτος γυρος με το υποκειδι SK16 αναιρει τον 16ο γυρο της κρυπτογραφησης …. Ο 16ος γυρος με το υποκλειδι SK1 αναιρει τον πρωτο γυρο της κρυπτογραφησης Τελος το τελικο βημα FP αναιρει το αρχικο βημα IP της κρυπτογραφησης Κι ετσι καταληγουμε στα αρχικα δεδομενα. As with any Feistel cipher, DES decryption uses the same algorithm as encryption except that the subkeys are used in reverse order SK16 .. SK1. If you trace through the DES overview diagram can see how each decryption step top to bottom with reversed subkeys, undoes the equivalent encryption step moving from bottom to top.

15 Ισχυς του DES – Μεγεθος Κλειδιου
Τα κλειδια των 56-bit εχουν 256 = 7.2 x 1016 τιμες Δυσκολο να σαρωθουν με επιθεση brute force Οι σχετικα προσφατες εξελιξεις ομως, δειχνουν οτι αυτο ειναι δυνατο. Το 1997 με χρηση του Internet σε λιγους μηνες Το 1998 με χρηση ειδικα σχεδιασμενου hardware μεσα σε λιγες μερες. Το 1999 με συνδυασμο των παραπανω μεσα σε 22 ώρες! Ωστοσο πρεπει παντα να εχει τη δυνατοτητα ο επιτιθεμενος να αναγνωριζει το plaintext Since its adoption as a federal standard, there have been lingering concerns about the level of security provided by DES in two areas: key size and the nature of the algorithm. With a key length of 56 bits, there are 256 possible keys, which is approximately 7.2*1016 keys. Thus a brute-force attack appeared impractical. However DES was finally and definitively proved insecure in July 1998, when the Electronic Frontier Foundation (EFF) announced that it had broken a DES encryption using a special-purpose "DES cracker" machine that was built for less than $250,000. The attack took less than three days. The EFF has published a detailed description of the machine, enabling others to build their own cracker [EFF98]. There have been other demonstrated breaks of the DES using both large networks of computers & dedicated h/w, including: on a large network of computers in a few months on dedicated h/w (EFF) in a few days above combined in 22hrs! It is important to note that there is more to a key-search attack than simply running through all possible keys. Unless known plaintext is provided, the analyst must be able to recognize plaintext as plaintext. Clearly must now consider alternatives to DES, the most important of which are AES and triple DES.

16 Ισχυς του DES – Αναλυτικες Επιθεσεις
Συγκεντρωνοντας πληροφοριες για τις κρυπτογραφησεις μπορει κανεις να ανακαλυψει ολα τα μερικα η και ολα τα υποκλειδια Αν χρειαζεται, μπορει να ψαξει εξαντλητικα για τα υπολοιπα Γενικα αυτες ειναι στατιστικες επιθεσεις. Διαφορική Κρυπταναλυση (differential cryptanalysis) Γραμμικη Κρυπταναλυση (linear cryptanalysis) Επιθεσεις σχετιζομενου κλειδιου (related key attacks) Another concern is the possibility that cryptanalysis is possible by exploiting the characteristics of the DES algorithm. The focus of concern has been on the eight substitution tables, or S-boxes, that are used in each iteration. These techniques utilise some deep structure of the cipher by gathering information about encryptions so that eventually you can recover some/all of the sub-key bits, and then exhaustively search for the rest if necessary. Generally these are statistical attacks which depend on the amount of information gathered for their likelihood of success. Attacks of this form include differential cryptanalysis. linear cryptanalysis, and related key attacks.

17 Ισχυς του DES – Επιθεσεις Χρονισμου
Επιτιθεται στην υλοποιηση του αλγοριθμου Χρησιμοποιει γνωση των συνεπειων της υλοποιησης για να εξαγει πληροφοριες για μερικα ή ολα τα υποκλειδια Συγκεκριμενα, χρησιμοποιει το γεγονος οτι οι υπολογισμοι μπορουν να εχουν διαφορετικους χρονους εκτελεσης αναλογα με το σε τι input εκτελουνται We will discuss timing attacks in more detail later, as they relate to public-key algorithms. However, the issue may also be relevant for symmetric ciphers. A timing attack is one in which information about the key or the plaintext is obtained by observing how long it takes a given implementation to perform decryptions on various ciphertexts. A timing attack exploits the fact that an encryption or decryption algorithm often takes slightly different amounts of time on different inputs. The AES analysis process has highlighted this attack approach, and showed that it is a concern particularly with smartcard implementations, though DES appears to be fairly resistant to a successful timing attack.

18 Κρυπτανάλυση στον DES Όντας πρότυπο για πολλά χρόνια, ο DES κίνησε το ενδιαφέρον πολλών κρυπταναλυτών για την εύρεση μεθόδων που θα μπορούσαν να τον «σπάσουν» Βασικοί αλγόριθμοι κρυπτανάλυσης Διαφορική κρυπτανάλυση [differential cryptanalysis – Biham and Shamir (1990)] Γραμμική κρυπτανάλυση [linear cryptanalysis – Matsui (1993)] Συλλογή στοιχείων με τις δύο αυτές μεθόδους υπάρχουν στη διεύθυνση: Οι μέθοδοι αυτές εφαρμόζονται σε κάθε νέο αλγόριθμο που προτείνεται, για τον έλεγχο της ασφάλειάς του

19 Διαφορική Κρυπτανάλυση
Εξεταζει ζευγη κρυπτογραμματων, των οποιων τα αρχικα μηνυματα διαφερουν σε συγκεκριμενες θέσεις (chosen-plaintext attack) Προσομοιωνοντας τον αλγοριθμο, καποια κλειδια είναι πιο πιθανα από καποια άλλα, με δεδομενη την παραπάνω συνθηκη Οσο πιο πολλα κρυπτογραφηματα αναλυονται, τοσο πιο πολλα κλειδιά «απορριπτονται» ως λιγοτερο πιθανα Οι λεπτομερειες της μεθοδου εινα πολυ συνθετες Οι 8 γυροι του DES «σπανε» με γνωστα 214 επιλεγμενα αρχικα μηνυματα (chosen plaintexts). Ολοι οι 16 γύροι του DES ομως χρειαζονται 247 επιλεγμένα αρχικα μηνυματα Αναφορά: «Differential Cryptanalysis of DES-like cryptosystems», Ε. Biham, A. Shamir, Crypto 1990

20 Γραμμική Κρυπτανάλυση
Αναζητειται γραμμικοτητα στο συστημα Εστω οτι γινονται XOR τα bits ενός αρχικου μηνυματος, XOR τα bits του αντιστοιχου κρυπτογραμματος και XOR τα δυο αποτελεσματα. Ιδανικα, η πιθανοτητα αυτου του bit αποτελεσματος να είναι 1 ή 0 θα έπρεπε να είναι ½. Οταν δεν ισχυει, μπορεί να εξαχθει καποια πληροφορια για το κλειδι Η παραπάνω πιθανοτητα εξαρταται κυριως από τη γραμμικοτητα των S-boxes Οι λεπτομερειες της μεθοδου ειναι επισης συνθετες Καλα αποτελεσματα για λιγους γυρους του DES, οχι ομως για το συνολο του (οπου χρειαζονται 243 επιλεγμενα γνωστα αρχικα μηνυματα) Αναφορα: «Linear Cryptanalysis Method for DES Cipher», Matsui M., Advances in Cryptology -- EUROCRYPT '

21 Σχεδιαστικα Κριτηρια του DES (DES Design Criteria)
Οπως αναφερεται απο τον Coppersmith [COPP94] 7 κριτηρια για τα S-boxes εξασφαλιζουν Μη γραμμικότητα Αντισταση στη διαφορικη κρυπταναλυση Καλη συγχυση 3 κριτηρια για την αντιμεταθεση P εξασφαλιζουν Αυξημενη διαχυση Although much progress has been made in designing block ciphers that are cryptographically strong, the basic principles have not changed all that much since the work of Feistel and the DES design team in the early 1970s. Some of the criteria used in the design of DES were reported in [COPP94], and focused on the design of the S-boxes and on the P function that distributes the output of the S boxes, as summarized above. See text for further details.

22 Triple DES (3DES) Παραλλαγή του DES, η οποία
παρέχει περισσότερη ασφάλεια Ο 3DES χρησιμοποιεί τρία κλειδιά των 56-bit C=Ek3(Dk2(Ek1(P))) P=Dk1(Ek2(Dk3(C))) Σημείωση: αν K1=K2, τότε 3DES=DES

23 AES- Advanced Encryption Standard
Το 1997, ο NIST προσκάλεσε δημόσια για ορισμό νέου προτύπου Ως ελάχιστο μήκος κλειδιού τέθηκε 128 bits Δυνατότητα υλοποίησης σε επεξεργαστές 8 bit To 1998, επελέχθησαν 15 επικρατέστεροι Αργότερα, έμειναν 5 επικρατέστεροι MARS (IBM - ΗΠΑ) RC6 (RSA Labs - ΗΠΑ) Rijndael (Daemen and Rijmen – Βέλγιο) SERPENT (Anderson, Biham, and Knudsen – Μεγάλη Βρετανία, Ισραήλ, Νορβηγία) TWOFISH (Schneier, Kelsey, και άλλοι - ΗΠΑ) Rijndael developed by two belgian crypt relies more on algebraic constructs 10 rounds consisting of 4 operations – sub, shift, perm, addition

24 Advanced Encryption Standard (AES) (ΙΙ)
Τελικοί βαθμοί των 5 επικρατέστερων αλγορίθμων: Το 2000, ανακοινωθηκε ως νικητης αλγοριθμος ο Rijndael.

25 Αλγόριθμος Rijndael Μήκη κλειδιού 128, 192, 256 bits
Μήκη blocks δεδομένων 128, 192, 256 bits Εύκολη υλοποίηση hardware 10-15 γύροι, ανάλογα με το μήκος του κλειδιού Κάθε γύρος έχει 4 βήματα: Αντικατάσταση byte (Byte substitution) – χρήση s-boxes με καλά χαρακτηριστικά Ολίσθηση (Shift row) Συνδυασμός πολλών bit (Mix Column) Πρόσθεση (XOR) του κλειδιού

26 Σύγκριση DES, 3DES, AES DES 3DES AES Key Length (bits) 56 112 or 168
128, 192, 256 Strength Weak Strong Strong Processing Requirements Moderate High Modest RAM Requirements Moderate High Modest

27 Άλλοι Block Ciphers Blowfish (Schneier) ( CAST ( Int’l Data Encryption Alg (IDEA), Lai and Masey ( Safer (Secure and Fast Encryption Routine) ( RC5 (

28 Συνοψη Κρυπτογραφικοι αλγοριθμοι τμηματων εναντι ροης
Σχεδιασμος και Δομη Feistel cipher DES Διαφορικη και Γραμμικη Κρυπτανάλυση Triple DES AES Αναφορα Κ.Χαλατσης, «Εισαγωγη στην Κρυπτογραφια», Lecture Notes. Chapter 3 summary.


Κατέβασμα ppt "Cryptography and Network Security Chapter 3"

Παρόμοιες παρουσιάσεις


Διαφημίσεις Google