# Cryptography

date post

03-Dec-2014Category

## Documents

view

54download

0

Embed Size (px)

### Transcript of Cryptography

CRYPTOGRAHYA Seminar Presentation

Prepared By :

What is Cryptography? Cryptography?Cryptography is the science of using mathematics to encrypt and decrypt data. Cryptography enables you to store sensitive information or transmit it across insecure networks (like the Internet) so that it cannot be read by anyone except the intended recipient. Along with keeping secrets it has a variety of application such as Authentication , Digital signature, Electronic voting.

Why Use Cryptography?For secret writing To establish a shared secret when other people (eavesdroppers) are listening.

bla-bla

ciphertext msg

encoder(plaintext in ciphertext out) eavesdropper(should understand nothing about the msg)

decoder (ciphertext in- plaintext out)cmb-cmb bla-bla

VocabularyPlaintext: Plaintext: Data that can be read and understood without any special measures. Encryption: The method of disguising plaintext in such a way as to hide its substance is called encryption. Cipher text: Encrypting plaintext results in unreadable gibberish called cipher text. Decryption: Decryption: The process of reverting cipher text to its original plaintext is called decryption. Key: Key: some secret piece of information that customizes how the cipher text is produced.

Cryptanalysis: Cryptanalysis: The art of breaking ciphers, i.e. retrieving the plaintext without knowing the proper key. Cryptographers: Cryptographers: People who do cryptography Cryptanalysts: Cryptanalysts: Practitioners of cryptanalysis. Cryptology: Cryptology: The branch of mathematics that studies the mathematical foundations of cryptographic methods. Cipher: Cipher: The Encoder, i.e., the encryption/decryption scheme

Encryption and Decryption

CLASSIFICATIONCryptography

Symmetric key cryptography

Asymmetric key cryptography (Public key cryptography)

Classical cryptography

Modern cryptography

Transposition cipher

Substitution cipher

Stream cipher

Block cipher

Symmetric key cryptographySame key for both encryption and decrytion.

Both should know the key

Transposition CipherIn classical cryptography, a transposition cipher changes one character from the plaintext to another i.e the order of the characters is changed. Reil fence cipher, column transposition etc .

Rail fenceIn the rail fence cipher, the plaintext is written downwards on successive "rails" of an imaginary fence, starting a new column when we get to the top. The message is then read off in rows. For example, if we have 3 "rails" and a message of 'WE ARE DISCOVERED. FLEE AT ONCE', the cipherer writes out: WRIORFEOEP EESVELANJD ADCEDETCXQ

The cipher text will be WRIOR FEOEP EESVE LANJD ADCED ETCXQ . The rail fence cipher is not very strong; the number of practical keys is small enough that a cryptanalyst can try them all by hand.

The easiest way to decipher a rail fence cipher is to use the following method: 1) First, run all the letters into a long string. [ WRIORFEOEPEESVELANJDADCEDETCXQ ] 2) Next, divide the string of letters into a number of even groups equal to the number of rails. [ WRIORFEOEP|EESVELANJD|ADCEDETCXQ ] Since there are 30 letters, and we know there are 3 rails, we divide the group into 3 groups of 10. 3) Finally, write down the first letter from group 1, from group 2, and group 3, followed by the second letter from group 1, group 2, and group 3, etc. [ WEAREDISCOVEREDFLEEATONCEXPDQ ] 4) Now just break the string of letters into easily identifyable words, separate the nulls, and the code is deciphered

Columnar transpositionIn a columnar transposition, the message is written out in rows of a fixed length, and then read out again column by column, and the columns are chosen in some scrambled order. Both the length of the rows and the permutation of the columns are usually defined by a keyword. For example, the word ZEBRAS is of length 6 (so the rows are of length 6), and the permutation is defined by the alphabetical order of the letters in the keyword. In this case, the order would be "6 3 2 4 1 5".

Example: suppose we use the keyword ZEBRA and the message WE ARE DISCOVERED. FLEE AT ONCE. In a regular columnar transposition, we write this into the grid as: 6 3 2 4 1 5 W E A R E D I S C O V E R E D F L E E A T O N C E Q K J E U Providing five nulls (QKJEU) at the end. The ciphertext is then read off as: EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE

Substitution cipherSubstitution cipher is a method of encryption by which units of plaintext are substituted with ciphertext according to a regular system. Caesar cipher, mono alphabetic substitution, poly alphabetic substituion.

Caesar cipherIn cryptography, a Caesar cipher, also known as a Caesar's cipher or the shift cipher, is one of the simplest and most widely-known encryption widelytechniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions further down the alphabet. For example, with a shift of 3, A would be replaced by D, B would become E, and so on.

(Figure showing working of a caesar cipher)

Encryption of a letter x by a shift n can be described mathematically as, Decryption is performed similarly, Example : Plaintext : the quick brown fox jumps over the lazy dog. Ciphertext : WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ.

Disadvantage:The main disadvantage of this type of cipher is , crypt analysis is very easier because there are only 26 possible shift keys .The key (shift) can be any value in the range 0 through 25 (there are 26 letters in the English alphabet), we can simply display all the 26 possible cases, and easily pick out the one that gives plaintext.

Monoalphabetic cipherA more sophisticated system uses a random series of characters for the lower alphabet. e.g : ABCDEFGHIJKLMNOPQRSTUVWXYZ IPHBOSFCQZJNTWGLMYRXDKEUVA Here the numbers of possible substitutions are 403,291,461,126,605,635,584,000,000 for an alphabet of 26 letters. Hence its more complex than Caesar cipher but still can be broken by some sort of frequency calculation of the alphabets in a cipher text.

Polyalphabetic cipherThe polyalphabetic substitution cipher consists of using several Caesar ciphers in sequence with different shift values. A PolyAlphabetic Substitution Cipher has: 1. A set of related monoalphabetic substitution rule. 2. A key to determine which particular rule is chosen for a given transformation

Vigenre cipher (A polyalphabetic substitution).To encrypt a plane text use the following table and do the following steps

Steps:

Choose a key. Extract the first letter in the plaintext, p, and the first letter in the key, q Use p to select a column in the tableau and q to select a row in the tableau. The character in the corresponding cell is the ciphertext character Repeat for the second plaintext character, and second key letter, and so on. When you come to the end of the key, you wrap around to the first letter of the key. The length of the key is called the period of the cipher.

e.g : Plaintext: ATTACKATDAWN Key: LEMONLEMONLE Ciphertext: LXFOPVEFRNHR Though it is more complex still it is breakable by some sort of frequency calculation.

Stream cipherA Stream Cipher is a symmetric or secret-key encryption secretalgorithm that encrypts a single bit at a time. With a Stream Cipher, the same plaintext bit or byte will encrypt to a different bit or byte every time it is encrypted. e.g : Plain text: pay 100 Binary of plain text: 010111101(hypothetical) Key: 100101011 ----- perform XOR __________________________ Cipher text 110010110 ------- ZTU9^%D

To decrypt make the XOR operation of the cipher text with the key

Block cipherBlock cipher technique involves encryption of one block of text at a time .Decryption also takes one block of encrypted text at atime. Length of the block is usually 64 or 128 bits. e.g : Plain text: four and five Four and five Key Key Key wvfa ast wvfa --- cipher text

Electronic Codebook Mode (ECB)

The most straightforward way of encrypting a longer plaintext is to use Electronic Codebook mode, or mode, ECB. ECB. Ci=Ek(Pi)for i=1.N Where Pi=plain text Ci=cipher text. E=encoding alogorithm. K=key N=number of cipher text. ECB has serious shortcomings:

If two plaintext blocks are the same, then the corresponding ciphertext blocks will be the same, which is visible to an attacker. Depending on the structure of the message, this can leak a lot of information. It is strongly recommended that ECB not be used for message encryption.

Cipher Block Chaining Mode (CBC)Cipher Block Chaining mode (CBC) avoids the problems with ECB by XORing each plaintext block with the previous ciphertext block: Ci=Ek(Pi+Ci-1). Ci=Ek(Pi+Ci-

Asymmetric key cryptographyPublic key cryptography is an asymmetric scheme that uses a pair of keys for encryption: a public key, key, which encrypts data, and a corresponding private key (secret key) for decryption key)

The primary benefit of public key cryptography is that it allows people who have no preexisting security arrangement to exchange messages securely. The need for sender and receiver to share secret keys via some secure channel is eliminated; all communications involve only public keys, and no private key is ever transmitted or shared. e.g: RSA algorithm.

Digital SignaturePublic key cryptography is also used to provide digital signatures. plaintext signing private key signed message verification public key plaintext signed message

Transmitting over an insecure channel.Alice wants to send Bob a private message.

Apublic is Alices public key. Aprivate is Alices private key. Bpublic is Bobs public key. Bprivate is Bobs private key.

Alice

Bob

enc

*View more*