K. Salah1 Cryptography Module II. K. Salah2 Data Encryption Standards DES.

Slides:



Advertisements
Similar presentations
DES The Data Encryption Standard (DES) is a classic symmetric block cipher algorithm. DES was developed in the 1970’s as a US government standard The block.
Advertisements

Lecture 5: Cryptographic Hashes
Origins  clear a replacement for DES was needed Key size is too small Key size is too small The variants are just patches The variants are just patches.
“Advanced Encryption Standard” & “Modes of Operation”
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Symmetric Encryption Example: DES Weichao Wang. 2 Overview of the DES A block cipher: – encrypts blocks of 64 bits using a 64 bit key – outputs 64 bits.
Web Security for Network and System Administrators1 Chapter 4 Encryption.
 Stream ciphers o Encrypt chars/bits one at a time o Assume XOR w the key, need long key to be secure  Keystream generators (pseudo-random key) o Synchronous.
PIITMadhumita Chatterjee Security 1 Hashes and Message Digests.
Cryptography and Network Security
Review Overview of Cryptography Classical Symmetric Cipher
Hash functions a hash function produces a fingerprint of some file/message/data h = H(M)  condenses a variable-length message M  to a fixed-sized fingerprint.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
Chapter 5 Cryptography Protecting principals communication in systems.
AES clear a replacement for DES was needed
Information Security and Management 11
1 Overview of the DES A block cipher: –encrypts blocks of 64 bits using a 64 bit key –outputs 64 bits of ciphertext A product cipher –basic unit is the.
Kemal AkkayaWireless & Network Security 1 Department of Computer Science Southern Illinois University Carbondale CS 591 – Wireless & Network Security Lecture.
Secure Hashing and DSS Sultan Almuhammadi ICS 454 Principles of Cryptography.
Cryptography and Network Security (AES) Dr. Monther Aldwairi New York Institute of Technology- Amman Campus 10/18/2009 INCS 741: Cryptography 10/18/20091Dr.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
Introduction to Symmetric Block Cipher Jing Deng Based on Prof. Rick Han’s Lecture Slides Dr. Andreas Steffen’s Security Tutorial.
Cryptography and Network Security Chapter 5. Chapter 5 –Advanced Encryption Standard "It seems very simple." "It is very simple. But if you don't know.
Cryptography and Network Security Chapter 5 Fourth Edition by William Stallings.
Computer Networking Lecture 21: Security and Cryptography Thanks to various folks from , semester’s past and others.
CS Network Security Lecture 2 Prof. Katz. 9/7/2000Lecture 2 - Data Encryption2 DES – Data Encryption Standard Private key. Encrypts by series of.
Lecture 23 Symmetric Encryption
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Dr. Lo’ai Tawalbeh 2007 Chapter 5: Advanced Encryption Standard (AES) Dr. Lo’ai Tawalbeh New York Institute of Technology (NYIT) Jordan’s Campus.
Cryptography1 CPSC 3730 Cryptography Chapter 11, 12 Message Authentication and Hash Functions.
Encryption Schemes Second Pass Brice Toth 21 November 2001.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
1 Chapter 4 Encryption. 2 Objectives In this chapter, you will: Learn the basics of encryption technology Recognize popular symmetric encryption algorithms.
Chapter 12 Cryptography (slides edited by Erin Chambers)
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Network Security (A Very Brief Introduction)
Chapter 5 Advanced Encryption Standard. Origins clear a replacement for DES was needed –have theoretical attacks that can break it –have demonstrated.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester
Chapter 5 –Advanced Encryption Standard "It seems very simple." "It is very simple. But if you don't know what the key is it's virtually indecipherable."
Applied Cryptography Example: AES. Advanced Encryption Standard "It seems very simple." "It is very simple. But if you don't know what the key is it's.
Cryptography and Network Security Chapter 6. Multiple Encryption & DES  clear a replacement for DES was needed theoretical attacks that can break it.
1 Chapter 3 Ciphers Mechanism that decides the process of encryption/decryption Stream Cipher: Bit-by-bit encryption / decryption Block Cipher: Block-by-block.
9/17/15UB Fall 2015 CSE565: S. Upadhyaya Lec 6.1 CSE565: Computer Security Lecture 6 Advanced Encryption Standard Shambhu Upadhyaya Computer Science &
Advance Encryption Standard. Topics  Origin of AES  Basic AES  Inside Algorithm  Final Notes.
Chapter 20 Symmetric Encryption and Message Confidentiality.
Chapter 20 Symmetric Encryption and Message Confidentiality.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
3DES and Block Cipher Modes of Operation CSE 651: Introduction to Network Security.
Cryptographic Hash Functions and Protocol Analysis
Advanced Encryption Standard. Origins NIST issued a new version of DES in 1999 (FIPS PUB 46-3) DES should only be used in legacy systems 3DES will be.
Lecture 23 Symmetric Encryption
Symmetric Encryption Lesson Introduction ●Block cipher primitives ●DES ●AES ●Encrypting large message ●Message integrity.
Advanced Encryption Standard Dr. Shengli Liu Tel: (O) Cryptography and Information Security Lab. Dept. of Computer.
Security fundamentals Topic 4 Encryption. Agenda Using encryption Cryptography Symmetric encryption Hash functions Public key encryption Applying cryptography.
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
Information Security and Management 11. Cryptographic Hash Functions Chih-Hung Wang Fall
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
1 CPCS425: Information Security (Topic 5) Topic 5  Symmetrical Cryptography  Understand the principles of modern symmetric (conventional) cryptography.
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
Chapter 12 – Hash Algorithms
School of Computer Science and Engineering Pusan National University
مروري برالگوريتمهاي رمز متقارن(كليد پنهان)
PART VII Security.
Introduction to Symmetric-key and Public-key Cryptography
Chapter -3 ADVANCED ENCRYPTION STANDARD & BLOCK CIPHER OPERATION
Presentation transcript:

K. Salah1 Cryptography Module II

K. Salah2 Data Encryption Standards DES

K. Salah3 Product block P-boxes and S-boxes can be combined to get a more complex cipher block, called Product block. P-boxes and S-boxes can be combined to get a more complex cipher block, called Product block. Data Encryption Standard (DES) uses an algorithm that encrypts a 64-bit plaintext chunks using a 56-bit key. The text is put through 19 different and complex procedures/rounds to create a 64-bit ciphertext. Data Encryption Standard (DES) uses an algorithm that encrypts a 64-bit plaintext chunks using a 56-bit key. The text is put through 19 different and complex procedures/rounds to create a 64-bit ciphertext.

K. Salah4 General scheme of DES DES has two transposition blocks, one swapping block, and 16 complex blocks called iteration blocks. DES has two transposition blocks, one swapping block, and 16 complex blocks called iteration blocks. The 16 iterative blocks are conceptually the same, but each uses a different key derived from the original key. The 16 iterative blocks are conceptually the same, but each uses a different key derived from the original key. DES works on 8 characters (bytes) at a time. DES works on 8 characters (bytes) at a time.

K. Salah5 Iteration block In each block, the previous right 32 bits become the next left 32 bits (swapping). The next right 32 bits, however, come from first applying an operation (a function) on the previous right 32 bits and then XORing the result with the left 32 bits. The “Function” f(R,K) expands R to 48 bits xor R with K Result is permuted from a table Ki (i denotes iteration) is derived from the 56-bit key with left circular shift of 1 or 2 bits that is determined by a permutation table.

K. Salah6 Triple DES or 3DES DES has a key too short DES has a key too short 3DES has 3 DES blocks and 2 56-bit key (or 112-bit key) 3DES has 3 DES blocks and 2 56-bit key (or 112-bit key) More complex and thus more secure More complex and thus more secure

K. Salah7 DES Operation Modes ECB ECB CBC CBC CFM CFM CSM CSM

K. Salah8 ECB mode In Electronic code block (ECB) mode, we divide the long message into 64-bit blocks and encrypt each block separately. In Electronic code block (ECB) mode, we divide the long message into 64-bit blocks and encrypt each block separately. Encryption of each block is independent of other blocks in ECB mode. Encryption of each block is independent of other blocks in ECB mode. fault tolerant fault tolerant possible to break by encrypt and compare method possible to break by encrypt and compare method

K. Salah9 CBC mode In cipher block chaining (CBC) mode, the encryption (or decryption) of a block depends on all previous blocks. In cipher block chaining (CBC) mode, the encryption (or decryption) of a block depends on all previous blocks. To encrypt the second plaintext block (P 2 ), we first XOR it with the first cipher block (C 1 ) and then pass it through the encryption process. In this way, C 2 depends on C 1. To encrypt the second plaintext block (P 2 ), we first XOR it with the first cipher block (C 1 ) and then pass it through the encryption process. In this way, C 2 depends on C 1. IV is typically part of the key, or generated off the key randomly (based on a random function). IV is typically part of the key, or generated off the key randomly (based on a random function).

K. Salah10 CFM Cipher feedback mode (CFM) was created for those situations in which we need to send or receive data one byte at a time, but still want to use DES (or triple DES). Cipher feedback mode (CFM) was created for those situations in which we need to send or receive data one byte at a time, but still want to use DES (or triple DES). One solution is to make a 1-byte C N dependent on a 1-byte P N and another byte, which depends on 8 previous bytes itself. One solution is to make a 1-byte C N dependent on a 1-byte P N and another byte, which depends on 8 previous bytes itself. Why previous 8 bytes? Why previous 8 bytes?

K. Salah11 CSM To encrypt/decrypt 1 bit at a time and at the same time be independent of the previous bits, we can use cipher stream mode (CSM). To encrypt/decrypt 1 bit at a time and at the same time be independent of the previous bits, we can use cipher stream mode (CSM). In this mode, data are XORed bit by bit with a long, one-time bit stream that is generated by an initialization vector in a looping process. In this mode, data are XORed bit by bit with a long, one-time bit stream that is generated by an initialization vector in a looping process.

K. Salah12 Advanced Encryption Standards AES

K. Salah13 AES DES Considered too weak DES Considered too weak  Diffie, Hellman said in a few years technology would allow DES to be broken in days Design using 1999 technology published Diffe-Hellman is also an asymmetric algo  Design decisions not public S-boxes may have backdoors DES has built-in trapdoor. It is a claim but a strong one.

K. Salah14 Advanced Encryption Standard (AES) Motivations Replacement of DES Replacement of DES  Known vulnerabilities  Broken by exhaustive key search attack  Triple DES – secure but slow Need new standard that is: Need new standard that is:  Secure – practical cryptanalysis, resist known attacks  Cost effective  Easy to implement (software, hardware) and portable  Flexible AES follows the principles of AES follows the principles of  Open algorithm  Open disclosure No relation to government agency  no allegations of tampering with code No relation to government agency  no allegations of tampering with code

K. Salah15 AES Origin Started in 1997 and lasted for several years Started in 1997 and lasted for several years Requirements specified by NIST (National Institute of Standards and Technology) Requirements specified by NIST (National Institute of Standards and Technology)  Algorithm unclassified and publicly available  Available royalty free world wide  Symmetric key  Operates on data blocks of 128 bits  Key sizes of 128, 192, and 256 bits  Fast, secure, and portable  Active life of years  Provides full specifications

K. Salah16 AES Finalists  1999: Algorithm name ComplexitySpeed Security margin MARS (IBM- USA) ComplexFastHigh Serpent (Anserson, Biham, & Knudsen - U.K.) Simple - clean SlowHigh Rijndael (Joan Daemen/V. Rijmen – Belgium) Simple -clean FastGood RC6 (RSA Data Security, Ins. - USA) Very simple Very fast Low Twofish (Bruse Schneier and others - USA) ComplexFastHigh

K. Salah17 Rijndael Algorithm Chosen for: security, performance, efficiency, ease of implementation, and flexibility Chosen for: security, performance, efficiency, ease of implementation, and flexibility Symmetric, block cipher Block cipher (block size variable and depends on key length) Block cipher (block size variable and depends on key length) Key size: 128, 192, or 256 bits Block size: 128  Processed as 4 groups of 4 bytes (state)  Operates on the entire block in every round Number of rounds depending on key size:  Key=128  9 rounds  Key=192  11 rounds  Key=256  13 rounds

K. Salah18 Strength of Algorithm New – little experimental results New – little experimental results Cryptanalysis results Cryptanalysis results  Few theoretical weakness  No real problem Has sound mathematical foundation Has sound mathematical foundation

K. Salah19 Rijndael – Basic Steps Byte Substitution: Non-linear function for confusion  S-box used on every byte (table look- up) Shift Rows: Linear mixing function for diffusion  Permutes bytes between columns  Different for different block sizes (128, 192 same, 256 different) Mix columns: Transformation  Shifting left and XOR bits  Effect: matrix multiplication Add Round Key: incorporates key and creates confusion  XOR state with unique key All operations can be combined into XOR and table look-ups  Very fast and efficient A nice demo is available at:

K. Salah20 AES Operation Modes CBC (Cipher Block Chaining) CBC (Cipher Block Chaining)  Used with IPSec ECB (Electronic CodeBook) ECB (Electronic CodeBook) CFB (Cipher FeedBack) CFB (Cipher FeedBack) OFB (Output FeedBack) OFB (Output FeedBack) CTR (Counter). CTR (Counter).

K. Salah21 Other Secret Key Algorithms DESX: modification of DES DESX: modification of DES Blowfish: fast, compact and simple block cipher. Variable key length up to 448 bits Blowfish: fast, compact and simple block cipher. Variable key length up to 448 bits RC2: block cipher. Variable key length up to 2048 bits RC2: block cipher. Variable key length up to 2048 bits RC4: stream cipher. Variable key length up to 448 bits RC4: stream cipher. Variable key length up to 448 bits RC5: block cipher. Allows user defined key length, data block size, and number of encryption rounds. RC5: block cipher. Allows user defined key length, data block size, and number of encryption rounds.

K. Salah22 Hash Functions

K. Salah23 Hash Functions A hash function is a function that maps an input of arbitrary length into a fixed number of output bits A hash function is a function that maps an input of arbitrary length into a fixed number of output bits Hash function h maps an input x of arbitrary length to a fixed length output h(x) (compression) Hash function h maps an input x of arbitrary length to a fixed length output h(x) (compression) Given h and x, h(x) is easy to compute (ease of computation) Given h and x, h(x) is easy to compute (ease of computation)  MD = h(x)  f(MD) = x does not exist Good hash functions must be collision free or have strong collision resistance Good hash functions must be collision free or have strong collision resistance  Two unique messages should not result in the same hash code Must be also “Computationally Infeasible” Must be also “Computationally Infeasible”  Not being able to go in the reverse direction

K. Salah24 Hash Functions Message digest Message digest Used for Used for  Authentication Password hashing (e.g SHA)  Data integrity Checksum, CRC, Hashing (e.g. MD5) Algorithms: Algorithms:  Requires password or secret key MAC (Message Authentication Code) Can verify both data integrity and data origin HMAC (Hash and MAC) Used by TLS (Transport Layer Security)  Do not require passwords SHA-1, MD2, MD4, MD5, RIPEMD-160 can verify only data integrity

K. Salah25 MD5 Message Digest Algorithm Input of arbitrary length Input of arbitrary length  Gets broken into blocks of size 512 bits Output: 128 bits Output: 128 bits

K. Salah26 MD5 Processing Append padding bits so length  448 mod 512 (padded message 64 bits less than an integer multiplied by 512) Append padding bits so length  448 mod 512 (padded message 64 bits less than an integer multiplied by 512) Append length: a 64-bit representation of the length of the original message (before the padding)  total length of message k*512 bits Append length: a 64-bit representation of the length of the original message (before the padding)  total length of message k*512 bits Initialize MD buffer: 128-bit buffer holds intermediate and final results (4 32-bit registers, ABCD) Initialize MD buffer: 128-bit buffer holds intermediate and final results (4 32-bit registers, ABCD)

K. Salah27 MD5 Processing Process message in 512-bit blocks: Process message in 512-bit blocks:  4 rounds of processing  Similar structure but different logical function  Each round takes the 512-bit input and values of ABCD and modifies ABCD Output: from the last stage is a 128-bit digest Output: from the last stage is a 128-bit digest

K. Salah28 Strength of MD5 Every bit of plain text influences every bit of the the hash code Every bit of plain text influences every bit of the the hash code Complex repetition of the basic functions  unlikely that two random messages would have similar regularities Complex repetition of the basic functions  unlikely that two random messages would have similar regularities MD5 is as strong as possible for 128-bit digest (Rivest’s conjecture) MD5 is as strong as possible for 128-bit digest (Rivest’s conjecture)  Didn’t hold true  Latest news as of August 2004, MD5 got broken

K. Salah29 Secure Hash Algorithm SHA was developed by NIST SHA was developed by NIST 1993: Published as Federal Information Processing Standard (FIPS PUB 180) 1993: Published as Federal Information Processing Standard (FIPS PUB 180) Output: 160-bit digest Output: 160-bit digest

K. Salah30 SHA-2 (256, 384, 512)

K. Salah31 MD5 v.s. SHA-1 Very similar Very similar Security: SHA’s digest is 32 bits longer  without algorithm flows SHA is more secure Security: SHA’s digest is 32 bits longer  without algorithm flows SHA is more secure  Its collision resistance is much higher Speed: SHA has more steps and produces 160-bit buffer  SHA slower Speed: SHA has more steps and produces 160-bit buffer  SHA slower Simplicity and compactness: MD5 has more internal steps with varying buffer modification  SHA is simpler Simplicity and compactness: MD5 has more internal steps with varying buffer modification  SHA is simpler

K. Salah32 Dictionary Attacks and Salt “can you pass the salt please?” Use a dictionary of most commonly used passwords Use a dictionary of most commonly used passwords Encrypt/Hash and compare Encrypt/Hash and compare  Visit  Claim of 100% password recovery for any system or applications Salted hash of the passwords Salted hash of the passwords  Add a salt value to the password before hashing  Make dictionary attack so difficult  Each user has a salt value (random string)

K. Salah33 Microsoft Hashes Uses two hashes for backward compatibility with old system and apps Uses two hashes for backward compatibility with old system and apps  LM Hash LanManager Hash used by old windows OS and applications Limited to 7 characters Easy to break (in matter of hours) To generate the LM hash, the system converts the password from UNICODE to ANSI (one byte per character), and translates all characters into uppercase. After that, the password is divided to two chunks (7 chars each, padded with zeros if needed). Each part is used as a DES encryption key, to encrypt the pre-defined constant, and the results of encryption are stored in the system (merged into a single 16-byte value). So, if your system uses LM authentication (and so LM hashes are available), the real password length (complexity) is just 7 characters, and the 14-character password is not much stronger than one of 7 characters.  NT Hash More secure Uses MD4 Hard to break takes years

K. Salah34 Unix & Linux Password History /etc/shadow contains the hashed passwords and accessed by root only, however, /etc/passwd contains *** Latest implementations of Unix & Linux uses DES and MD5 with salting, respectively.

K. Salah35 Example of file encryption with password

K. Salah36 Public Key Encryption

K. Salah37 Public-key cryptography In public-key cryptography, there are two keys: a private key and a public key. The private key is kept by the receiver. The public key is announced to the public. In public-key cryptography, there are two keys: a private key and a public key. The private key is kept by the receiver. The public key is announced to the public. Public-key used for encryption is different from the private key that is used for decryption. Public key is available to the public; the private key is available only to an individual. Public-key used for encryption is different from the private key that is used for decryption. Public key is available to the public; the private key is available only to an individual. Each entity creates a pair of keys; the private one is kept, and the public one is distributed. Each entity is independent, and the pair of keys created can be used to communicate with any other entity. Each entity creates a pair of keys; the private one is kept, and the public one is distributed. Each entity is independent, and the pair of keys created can be used to communicate with any other entity. The second advantage is that the number of keys needed is reduced tremendously. The second advantage is that the number of keys needed is reduced tremendously. Public-key algorithms are more efficient for short messages. Public-key algorithms are more efficient for short messages. Complexity of the algorithm; association between an entity and its public key must be verified [Certification authority]. Complexity of the algorithm; association between an entity and its public key must be verified [Certification authority].

K. Salah38 RSA RSA (Rivest, Shamir, Adleman) is the most common public- key algorithm. RSA (Rivest, Shamir, Adleman) is the most common public- key algorithm. Private key is a pair of numbers (N,d). Private key is a pair of numbers (N,d). Public key is a pair of numbers (N,e). Public key is a pair of numbers (N,e). Note that N is common to the private and public keys. Note that N is common to the private and public keys. Sender algorithm to encrypt: C=P e mod N Sender algorithm to encrypt: C=P e mod N P is plaintext, which is represented as a number; C is the number that represents the ciphertext. The two numbers e and N are components of the public key. P is plaintext, which is represented as a number; C is the number that represents the ciphertext. The two numbers e and N are components of the public key. Receiver algorithm to decrypt: P=C d mod N Receiver algorithm to decrypt: P=C d mod N Q: If I know 41 and 119, can I figure 77 by brute force? A: Yes Solution: ??

K. Salah39 Choosing RSA public and private keys Inventors of RSA used ‘number theory’ Inventors of RSA used ‘number theory’  Not any numbers work! Procedure to choose three numbers N, d, and e. Procedure to choose three numbers N, d, and e.  Choose two large prime numbers p and q.  Compute N = p * q  Choose e (less than N) such that e and (p-1)(q-1) are relatively prime (having no common factor other than 1)  Choose d such that (e*d) mod [(p-1)(q-1)] is equal to 1.