cryptography

30
CRYPTOGRAPHY

Upload: iama-marsian

Post on 22-May-2015

96 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Cryptography

CRYPTOGRAPHY

Page 2: Cryptography

Basic Concepts:-

• Cryptography - the art or science encompassing the principles and methods of transforming an intelligible message into one that is unintelligible, and then retransforming that message back to its original form.

• Plaintext - the original intelligible message.

• Cipher Text - the transformed message.

Page 3: Cryptography

• Cipher - an algorithm for transforming an intelligible message into one that is unintelligible by transposition and/or substitution methods

• Key - some critical information used by the cipher, known only to the sender and receiver

• Encipher (encode) - the process of converting plaintext to cipher text using a cipher and a key

Page 4: Cryptography

• Decipher (decode) - the process of converting cipher text back into plaintext using a cipher and a key.• Cryptanalysis - the study of

principles and methods of transforming an unintelligible message back into an intelligible message without knowledge of the key. Also called codebreaking.

Page 5: Cryptography

Working :-

Page 6: Cryptography

Example:-

Page 7: Cryptography

Applications:-

• ATM cards,• Computer passwords,• Electronic commerce, etc.

Page 8: Cryptography

Categories:-

Page 9: Cryptography

Symmetric-Key

• In symmetric-key cryptography, the same key is used by both parties. The sender uses this key and an encryption algorithm to encrypt data; the receiver uses the same key and the corresponding decryption algorithm to decrypt the data.

Page 10: Cryptography
Page 11: Cryptography

Asymmetric-Key

• In asymmetric or 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. The public key that is used for encryption is different from the private key that is used for decryption. The public key is available to the public; the private key is available only to an individual.

Page 12: Cryptography
Page 13: Cryptography

Symmetric-Key Ciphers:-

• Traditional Ciphers: These are character oriented ciphers.

Page 14: Cryptography

Substitution Cipher:-

• A substitution cipher substitutes one symbol with another. If the symbols in the plaintext are alphabetic characters, we replace one character with another. For example, we can replace character A with D, and character T with Z. If the symbols are digits (0 to9), we can replace 3 with 7, and 2 with 6. Substitution ciphers can be categorized as either monoalphabetic or polyalphabetic ciphers.

Page 15: Cryptography

Monoalphabetic Cipher:-• In a monoalphabetic cipher, a

character (or a symbol) in the plaintext is always changed to the same character (or symbol) in the ciphertext regardless of its position in the text. For example, if the algorithm says that character A in the plaintext is changed to character D, every character A is changed to character D. In other words, the relationship between characters in the plaintext and the ciphertext is a one-to-one relationship.

Page 16: Cryptography

Polyalphabetic Cipher:-

• In a polyalphabetic cipher, each occurrence of a character can have a different substitute. The relationship between a character in the plaintext to a character in the ciphertext is a one-to-many relationship. For example, character A could be changed to D in the beginning of the text, but it could be changed to N at the middle.

Page 17: Cryptography

Example:-

• The following shows a plaintext and its corresponding ciphertext. Is the cipher monoalphabetic?Plaintext: HELLOCiphertext: KHOOR• The cipher is probably

monoalphabetic because both occurrences of L's are encrypted as O's

Page 18: Cryptography

• The following shows a plaintext and its corresponding ciphertext. Is the cipher monoalphabetic?Plaintext: HELLOCiphertext: ABNZF

• The cipher is not monoalphabetic because each occurrence of L is encrypted by a different character. The first L is encrypted as N; the second as Z.

Page 19: Cryptography

Shift Cipher:-• The simplest monoalphabetic

cipher is probably the shift cipher. In this cipher, the encryption algorithm is "shift key characters down," with key equal to some number. The decryption algorithm is "shift key characters up." For example, if the key is 5, the encryption algorithm is "shift 5 characters down" (toward the end of the alphabet). The decryption algorithm is "shift 5 characters up" (toward the beginning of the alphabet). Of course, if we reach the end or beginning of the alphabet, we wrap around.

Page 20: Cryptography

Example:-• Use the shift cipher with key

= 15 to encrypt the message HELLO.• We encrypt one character at

a time. Each character is shifted 15 characters down. Letter H is encrypted to W. Letter E is encrypted to T. The first L is encrypted to A. The second L is also encrypted to A. And 0 is encrypted to D. The cipher text is WTAAD.

Page 21: Cryptography

• Use the shift cipher with key

=15 to decrypt the message "WTAAD.“• We decrypt one character at

a time. Each character is shifted 15 characters up. Letter W is decrypted to H. Letter T is decrypted to E. The first A is decrypted to L. The second A is decrypted to L. And, finally, D is decrypted to O. The plaintext is HELLO

Page 22: Cryptography

Transcomposition Cipher:-

• In a transposition cipher, there is no substitution of characters; instead, their locations change. A character in the first position of the plaintext may appear in the tenth position of the ciphertext. A character in the eighth position may appear in the first position. In other words, a transposition cipher reorders the symbols in a block of symbols.

Page 23: Cryptography

• Key in a transposition cipher is a mapping between the position of the symbols in the plaintext and cipher text. For example, the following shows the key using a block of four characters:Plaintext: 2 4 31Ciphertext: 1 2 3 4

• In encryption, we move the character at position 2 to position 1, the character at position 4 to position 2, and so on. In decryption, we do the reverse

Page 24: Cryptography

Example:-

• Encrypt the message “DEAR" using the key:Plaintext: 2 4 31Ciphertext: 1 2 3 4• Solution: RDAE

Page 25: Cryptography

Simple Modern Ciphers:-

• The traditional ciphers we have studied so far are character-oriented. With the advent of the computer, ciphers need to be bit-oriented. This is so because the information to be encrypted is not just text; it can also consist of numbers, graphics, audio, and video data. It is convenient to convert these types of data into a stream of bits, encrypt the stream, and then send the encrypted stream.

Page 26: Cryptography

XOR Cipher:-

• An XOR operation needs two data inputs plaintext, as the first and a key as the second. In other words, one of the inputs is the block to be the encrypted, the other input is a key; the result is the encrypted block. Note that in an XOR cipher, the size of the key, the plaintext, and the ciphertext are all the same. XOR ciphers have a very interesting property: the encryption and decryption are the same.

Page 27: Cryptography
Page 28: Cryptography

Rotation Cipher:-

• Another common cipher is the rotation cipher, in which the input bits are rotated to the left or right. The rotation cipher can be keyed or keyless. In keyed rotation, the value of the key defines the number of rotations; in keyless rotation the number of rotations is fixed.

Page 29: Cryptography

Other Types:-

• Modern Round Ciphers• Data Encryption Standard

(DES)• Advanced Encryption

Standard (AES)• Electronic Code Book• RSA (Rivest, Shamir and

Adleman)• Diffie-Hellman

Page 30: Cryptography