1 / 42

Lesson 5-Cryptography

Lesson 5-Cryptography. Background. Cryptography is the science of encrypting information. The desire to hide information from others extends to ancient times. Writing enabled individuals to share information. Later, people also wanted to hide information.

nhu
Télécharger la présentation

Lesson 5-Cryptography

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lesson 5-Cryptography

  2. Background • Cryptography is the science of encrypting information. • The desire to hide information from others extends to ancient times. • Writing enabled individuals to share information. • Later, people also wanted to hide information. • The easiest way was not to teach others how to read and write the language. • As that became ineffective, methods of shifting the letters around to make the text unreadable were attempted. • Cryptanalysis is the process of analyzing available information to attempt to return the encrypted message to its original form.

  3. Background • Spartans used a ribbon wrapped around a specific gauge cylinder and then wrote on the ribbon. • When unwrapped, the ribbon appeared to hold a strange string of letters. • The message could be read only when someone wrapped the ribbon back around the same gauge cylinder. • The Romans used a different method known as a shift cipher. • One letter of the alphabet is shifted a set number of places in the alphabet for another letter. • A common modern-day example of this is the ROT13 cipher. In this method, every letter is rotated 13 positions in the alphabet. For example, n is written instead of a, and o instead of b. • These ciphers were simple to use and unfortunately also simple to break.

  4. Background • A famous example of a modern encryption machine is the German Enigma machine from World War II. http://www.tatjavanvark.nl/tvv1/pht10.html • This machine used a complex series of substitutions to perform encryption, and gave rise to great amounts of research in computers. • Cryptanalysis is the process of analyzing available information to return the encrypted message to its original form. • This required advances in computer technology for the more complex encryption methods. • A modern code decryptedhttp://members.aol.com/nova1337/tutorial03.htm

  5. Background • Computers allow users to execute more complex encryption algorithms easily. • Computer technology aids cryptanalysis by allowing users to try new methods, such as linear and differential cryptanalysis. • Differential cryptanalysisis done by comparing the input plaintext to the output ciphertext to try and determine the key. • Linear cryptanalysisis similar in that it uses both plaintext and ciphertext, but it puts the plaintext through a simplified cipher to try and deduce what the key is likely to be in the full version of the cipher.

  6. How Encryption and Decryption Work

  7. Encryption • Modes of encryption include: • Symmetric • Asymmetric • Hash functions • Encryption schemes: • All the current encryption schemes are based upon an algorithm, a recursive computational procedure for solving a problem in finite steps. • An algorithm is a step-by-step problem-solving procedure. • A cryptographic algorithmis a set of mathematical steps for encrypting and decrypting information.

  8. Steps for Encryption • Conventional cryptography is a substitution cipher in which one piece of information is substituted for another. • The steps for encrypting data are designed to use a key. • The algorithms remain the same. • Every implementation uses a different key. • This ensures that even if other know the algorithm, they cannot break the security.

  9. Cryptography Concepts • A Caesar cipher (early shift cipher) uses an algorithm and a key. • The algorithm specifies that you offset the letters of the alphabet either to the right (forward) or to the left (backward). • The key specifies how many letters the offset is. • The algorithm used in this example is the act of offsetting the letters while the key in this example would be the number of characters to offset it by. For example, encode the word "SECURITY" using a key value of 2 (where A=C, B=D, C=E, etc.). The resulting cipher would be "UGEWTKVA". • The time and resources it takes to recover the plaintext measures the strength of a cryptographic method, the early shift ciphers were very vulnerable.

  10. Substitution Cipher • The weakness of shift ciphers led to substitution ciphers. • Substitution cipher was very popular in Elizabethan England. • They substitute a different letter for every letter which permits 26 possible values for every letter in a message. • The cipher is more complex than a standard shift cipher. • But, simple analysis of the cipher retrieves the key. • Common letters and patterns represent a word, which makes it easy to determine which cipher letter corresponds to which plaintext letter. This determines this system's key value. (we have a lab assignment)

  11. Vigenère Cipher • The Vigenère cipher corrects the simplicity of the substitution cipher • It is a polyalphabetic substitution cipher that depends on a password. • This is done by setting up a substitution table, then the password is matched to the text it is meant to encipher. Substitution table

  12. Vigenère Cipher • The cipher letter is determined using the grid and matching the plaintext character's row with the password character's column. • This results in a single ciphertext character from where the two meet. • Even if someone knows the table (or algorithm), without the key (password), the message cannot be decrypted. Password = passwordpassw Plaintext = samplemessage = hae (etc)

  13. Brute Force • The Vigenere cipher system and other systems like it make the algorithms simple but the key complex. • Key complexity is achieved by assigning a large number of possible values to the key. • The keyspace is the size of every possible key value. When an algorithm lists a certain number of bits as a key, it is defining the keyspace. 1 bit (2 values) vs 1 letter (26 values). 56-bit key = 72,000,000,000,000,000 values. Computers can attempt billions of keys a second. • All encryption ciphers besides a “one-time pad” cipher are susceptible to a brute-force attack—attempting every possible key.

  14. One Time Pads • One-time pads have a key that is equal to the length of the message, and must use completely random data for the key, therefore unlimited keyspace. • Computers have difficulty using the Vigenere table (not in bit format), therefore, many encryption functions use a logical function to perform the decipherment. • XOR is the bitwise exclusive of OR. • If (P XOR K) = C then (C XOR K) = P • P=plaintext, C=ciphertext, K=key and sender and receiver have same shared key.

  15. Hashing • Common uses of hashing functions are storing computer passwords and ensuring message integrity, whereas digital signature provides nonrepudiation. • Algorithms include a hash which is a special mathematical function that performs one-way encryption. • Secure Hash Algorithm (SHA) • Message digest is the generic version of one of the three algorithms (MD2, MD4, MD5) , designed to create a message digest or hash from data input into the algorithm. • Once the algorithm is processed, there is no way to: • Take the ciphertext and retrieve the plaintext that was used to generate it. • Generate two different plaintexts that compute to the same hash value.

  16. MD2 • Message Digest 2 takes a data input of any length and produces a hash output of 128 bits. • MD2 is optimized for 8-bit machines and MD4 and MD5 are optimized for 32-bit machines. • The only known attack successful against MD2 depends on the checksum not being appended to the message before the hash function is run.

  17. MD4 • MD4 was developed in 1990 and is optimized for 32-bit computers. • It is a fast algorithm, but not as secure. • The final four words left after compression are the 128-bit hash. • There is an extended version of MD4 that computes the message in parallel and produces two 128-bit outputs. • Although a longer hash is produced, security has not been improved because of basic flaws in the algorithm.

  18. MD5 • Message Digest 5 is similar to the MD4 algorithm, but it is slightly slower and more secure. • MD5 creates a 128-bit hash of a message of any length. • There are no known attacks against MD5, but there has been cryptanalysis that displays weaknesses in the compression function.

  19. SHA • SHA was developed in 1993 by the National Institute of Standards and Technology for secure hashing in the U.S. Digital Signature Standard (DSS). • It uses block mode, accepting an input of up to 264 bits and compressing to 160 bits. • After hash has been generated for all blocks, the message is represented by a 160-bit string. • SHA is one of the more secure hash functions as its output is 160-bit long versus the more common 128-bit result from MD5. Collision attack = an attacker finds two different messages that hash to the same value.

  20. Symmetric versus Asymmetric Algorithms

  21. Key Management • Key management applies to all things that could happen to a key • Securing it on local computer • Securing it on remote computer • Protecting it from data corruption • Protecting it from loss • Protecting it in transit • Unlike hash functions, a cryptographic key is involved in symmetric encryption and the key unlocks the data you are trying to protect. • Key needs to be known or transmitted in a secret way to the other party.

  22. Symmetric Algorithms • Encryption key can be calculated from decryption key and vice versa • Require sender and receiver to agree on a key before they communicate securely • Security lies with the key • Also called secret key algorithms, single-key algorithms, or one-key algorithms

  23. Categories of Algorithms • Stream algorithms • Operate on the plaintext one bit at a time • Block algorithms • Encrypt and decrypt data in groups of bits, typically 64 bits in size • Most encryption algorithms in use today are based on a structure developed by Horst Feistel of IBM in 1973. • Lucifer (1974) to protect non-classified data. As the first-ever block cipher developed, it utilizes a 128-bit key and 16 rounds in the encryption process. Lucifer suffers from a weak key structure and is vulnerable to attacks, yet it still can be used in tandem with other algorithms effectively.

  24. Symmetric Cryptosystems Symmetric algorithms are comparatively faster and have fewer computational requirements. Their main weakness is that two geographically distant parties need to have same key. • IDEA - International Data Encryption Algorithm • CAST - Carlisle Adams and Stafford Tavares • DES – Data Encryption Standard • 3DES – DES With Two Keys • AES – Advanced Encryption Standard • TwoFish - Bruce Schneier Applied Cryptography • Blowfish – Bruce Schneier

  25. DES • DES (Data Encryption Standard) was first developed over twenty years ago from IBM’s “Lucifer” as a standard cryptographic algorithm. • The DES standard was recertified in 1993, but NIST is now considering the Advanced Encryption Standard (AES) to replace DES. • DES is a block cipher, that segments the input data into blocks of 64 bits, using a 56-bit key, and outputs blocks of 64-bits.

  26. DES • The same algorithm and key are used for both encryption and decryption. • DES performs 16 rounds of substitution and then permutation on the input, based upon the key. • After the completion of all the 16 rounds and the inverse permutation, the algorithm picks up the next 64 bits and starts all over again. • This is carried on until the entire message has been encrypted with DES. • Over the years there have been some concerns. • Weak keys are less secure than the majority of keys allowed in the keyspace of the algorithm. • There are also semi-weak keys, where two keys encrypt plaintext to identical ciphertext, meaning that either of the keys will decrypt the ciphertext.

  27. Triple DES • Triple DES (1998) - uses the same algorithm as DES, but uses three keys and three executions of the algorithm to encrypt and decrypt data, resulting in a 168-bit key. • It is three times slower than DES but much more secure. • Triple DES is very easy to implement in encryption systems that are currently using DES as its encryption algorithm. Diagram of 3DES

  28. Triple DES • Multiple encryption can be performed in different ways. • The simplest method of multiple encryption is to stack algorithms on top of each other. • Another way is to encrypt with one key, decrypt with a second, and then encrypt with a third. • This is a significant enhancement of security. • The only weaknesses of 3DES are the ones that already exist in DES. • 3DES is a good interim step before the new encryption standard is fully implemented.

  29. Advanced Encryption Standard • NIST requested a new Advanced Encryption Standard (AES). It called for a block cipher using symmetric key cryptography and supporting key sizes of 128, 192, and 256 bits. After evaluation, NIST had five finalists: • MARS – IBM • RC6 – RSA • Rijndael – John Daemen and Vincent Rijmen • Serpent – Ross Anderson, Eli Biham, and Lars Knudsen • Twofish – Bruce Schneier, John Kelsey, Doug Whiting, David Wagner, Chris Hall, and Niels Ferguson

  30. AES – Rijndael and CAST • In the fall of 2000, NIST picked Rijndael to be the new AES. • Rijndael is a block cipher separating data input in 128-bit blocks that can also be configured to use blocks of 192 or 256 bits. • This algorithm has suitable key length to provide security for many years. • CAST is an encryption algorithm that was submitted for the AES standard, but was not chosen. • There is currently no better way known to break high-round CAST than by brute forcing the key. • With sufficient key length, CAST should be placed with other trusted algorithms.

  31. Rivest Cipher (RC) • RC2 was designed to be a DES replacement. • RC2 is up to three times faster than DES, but the ability of RC2 to accept different key lengths is one of the vulnerabilities in the algorithm. • RC4 is a streamcipher, whereas all the symmetric ciphers were block-mode ciphers. • RC4 can use a key length of 8 to 2,048 bits, though the most common versions use 128-bit keys. • The algorithm is sometimes 10 times faster than DES. • The most vulnerable point of the encryption is the possibility of weak keys. • RC5 is a block cipher that contains multiple variable elements, numbers of rounds, key sizes, and block sizes. • RC5 provides adequate security for current brute forcing technology. It uses a variable key length and a variable number of rounds that makes it very flexible and adaptable. At this time, there are no known attacks for this algorithm. • RC6 uses a 128-bit block size, separated into four words of 32 bits each. • RC6 is a modern algorithm that runs well on 32-bit computers. • The available key lengths make brute-force attacks extremely time consuming.

  32. Blowfish and IDEA • Blowfish (1993) Blowfish was developed as a free, unpatented cipher by Bruce Schneier. • It is a block-mode cipher using 64-bit blocks and a variable key length from 32 to 448 bits. • It is designed to run quickly on 32-bit microprocessors. • It is optimized for situations where there are few key changes. • It is characterized by its ease of implementation, high execution speeds and low memory usage. At this time, there are no known attacks for this algorithm. • IDEA 1992 (International Data Encryption Algorithm) is a block-mode cipher using a 64-bit block size and a 128-bit key. • IDEA is susceptible to a weak key—a key made of all zeros. • However, this is easy to check and the weakness is simple to mitigate. • IDEA is commonly used in PGP and is a substitute for DES and Triple DES. There are no known attacks at this time for this algorithm.

  33. Asymmetric Algorithms • Use different keys for encryption and decryption • Decryption key cannot be calculated from the encryption key • Anyone can use the key to encrypt data and send it to the host; only the host can decrypt the data • Also known as public key algorithms

  34. Asymmetric Cryptosystems • Asymmetric Cryptography: • Is also known as public key cryptography. • Uses two keys instead of one. • Public key systems typically work using difficult math problems known as trapdoor functions. • creates the possibility of digital signatures. • It corrects weakness of symmetric cryptography. • Diffie-Hellman • RSA – Rivest-Shamir-Adleman • DSA – Digital Signature Algorithm • DSS – Digital Signature Standard • ECC • ElGamal

  35. RSA • RSA is one of the first public key cryptosystems invented. • It can be used for both encryption and digital signatures. • This algorithm uses the product of two very large prime numbers (from 100 to 200 digits) to generate one key for decryption and another for encryption. • RSA’s security has withstood the test of over 20 years of analysis, but in software it can be 100 times slower than DES. • Public key, the slower protocol, is used to exchange the private key, and then the communication uses the faster symmetric key protocol. • This process is known as electronic key exchange.

  36. Diffie-Hellman • Diffie-Hellman (1976) utilizes a public key system, which is the oldest public key system in use. It offers better performance than other encryption algorithms since it is focused on the trading of a shared key between two users who have not contacted each other before. • . Used in the electronic key exchange method of the Secure Sockets Layer (SSL) protocol. • Used by the SSH and commonly used in IPsec protocols. • The protocol, like RSA, uses large prime numbers to work. • It is very effective because it protects a temporary, automatically generated secret key that is only good for a single communication session.

  37. ElGamal and ECC • ElGamal is used as the U.S. government standard for digital signatures, and may also be used for encryption. • ECC - Elliptic curve cryptography (ECC) works on the basis of elliptic curves. • An elliptic curve is a simple function that is drawn as a gently looping curve on the X and Y plane. • Two points can be added to get a third point on the curve. • However, due to lack of analysis, the security of elliptic curve systems has been a concern.

  38. Confidentiality • Confidentiality – most widely recognized component and the primary purpose of early ciphers was to make sure that the information was kept secret • Symmetric encryption is favored to store and transmit data. • Asymmetric cryptography does protect confidentiality. • Size and speed make it more efficient at protecting the confidentiality of small units such as for electronic key exchange.

  39. Integrity • When a message is sent, both the sender and the recipient need to know that the message was not altered in transmission. • This integrity is provided with one-way hash functions and digital signatures. • A hash value is combined with asymmetric cryptography by taking the message's hash value and encrypting it with the user's private key. • Anyone with the user's public key decrypts the hash and compares it to the locally computed hash.

  40. Nonrepudiation and Authentication • Nonrepudiation means that the senders cannot later deny that they sent the message. • It is based upon public key cryptography and the principle of only you knowing your private key. • Authentication is being able to prove one’s identity. • Authentication can be done by a password, token, or biometric. • Digital certificates are one form of such tokens. • Asymmetric encryption is better suited than symmetric encryption to prove one’s identity.

  41. Digital Signatures • Digital signatures are based upon both hashing functions (provides message integrity) and asymmetric cryptography. • Create Message • Calculate Hash • Encrypt With Private Key • Append to Message • Recipient Decrypts With Public Key • Recipient Verifies Hash • Correct = Nonrepudiation

  42. Key Escrow • Key escrow is a system by which a private key is kept both by the user and by the government. • Key escrow and key recovery are two issues in the use of asymmetric encryption that are often discussed.

More Related