Top Banner
CRYPTOGRAHY CRYPTOGRAHY A Seminar A Seminar Presentation Presentation Prepared By :
43
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Cryptography

CRYPTOGRAHYCRYPTOGRAHYA Seminar A Seminar PresentationPresentation

Prepared By :

Page 2: Cryptography

What is CryptographyWhat is Cryptography??

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

Page 3: Cryptography

Why Use Cryptography?Why Use Cryptography?

For “secret writing” For “secret writing”

To establish a shared secret when other people To establish a shared secret when other people (eavesdroppers) are listening. (eavesdroppers) are listening.

Page 4: Cryptography

encoderdecoder

(plaintext in -ciphertext out)

ciphertext ciphertext msgmsg

(ciphertext in- plaintext out)

(should understandnothingnothingabout themsg)

eavesdropper

bla-blabla-bla

cmbcmb--cmbcmb bla-blabla-bla

Page 5: Cryptography

VocabularyVocabulary

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

Page 6: Cryptography

CryptanalysisCryptanalysis: The art of breaking ciphers, i.e. : The art of breaking ciphers, i.e. retrieving the plaintext without knowing the proper retrieving the plaintext without knowing the proper key.key.

CryptographersCryptographers: People who do cryptography: People who do cryptography

CryptanalystsCryptanalysts: Practitioners of cryptanalysis.: Practitioners of cryptanalysis.

CryptologyCryptology: The branch of mathematics that studies : The branch of mathematics that studies the mathematical foundations of cryptographic the mathematical foundations of cryptographic methods. methods.

CipherCipher: The Encoder, i.e., the encryption/decryption : The Encoder, i.e., the encryption/decryption schemescheme

Page 7: Cryptography

Encryption and DecryptionEncryption and Decryption

Page 8: Cryptography

CLASSIFICATIONCLASSIFICATION

CryptographyCryptography

Symmetric key Symmetric key Asymmetric keyAsymmetric key cryptography cryptography cryptography cryptography

(Public key cryptography)(Public key cryptography)

Classical Classical Modern Modern cryptography cryptographycryptography cryptography

Transposition Substitution Stream BlockTransposition Substitution Stream Block ciphercipher cipher cipher cipher cipher ciphercipher

Page 9: Cryptography

Symmetric key cryptographySymmetric key cryptography

Same key for both encryption and decrytion.

Both should knowthe key

Page 10: Cryptography

Transposition CipherTransposition Cipher

In classical cryptography, a transposition In classical cryptography, a transposition cipher changes one character from the cipher changes one character from the plaintext to another i.e the order of the plaintext to another i.e the order of the characters is changed.characters is changed.

Reil fence cipher, column transposition Reil fence cipher, column transposition etc .etc .

Page 11: Cryptography

Rail fenceRail fence

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

W R I O R F E O E PW R I O R F E O E P E E S V E L A N J DE E S V E L A N J D

A D C E D E T C X QA D C E D E T C X Q

Page 12: Cryptography

The cipher text will beThe cipher text will be

WRIOR FEOEP EESVE LANJD ADCED WRIOR FEOEP EESVE LANJD ADCED ETCXQ .ETCXQ .

The rail fence cipher is not very strong; the The rail fence cipher is not very strong; the number of practical keys is small enough that a number of practical keys is small enough that a cryptanalyst can try them all by hand.cryptanalyst can try them all by hand.

Page 13: Cryptography

The easiest way to decipher a rail fence cipher is to use the The easiest way to decipher a rail fence cipher is to use the following method:following method:

1) First, run all the letters into a long string.1) First, run all the letters into a long string. [ WRIORFEOEPEESVELANJDADCEDETCXQ ] [ WRIORFEOEPEESVELANJDADCEDETCXQ ] 2) Next, divide the string of letters into a number of even 2) Next, divide the string of letters into a number of even

groups equal to the number of rails.groups equal to the number of rails. [ WRIORFEOEP|EESVELANJD|ADCEDETCXQ ] Since [ WRIORFEOEP|EESVELANJD|ADCEDETCXQ ] Since

there are 30 letters, and we know there are 3 rails, we divide there are 30 letters, and we know there are 3 rails, we divide the group into 3 groups of 10.the group into 3 groups of 10.

3) Finally, write down the first letter from group 1, from group 3) Finally, write down the first letter from group 1, from group 2, and group 3, followed by the second letter from group 1, 2, and group 3, followed by the second letter from group 1, group 2, and group 3, etc.group 2, and group 3, etc.

[ WEAREDISCOVEREDFLEEATONCEXPDQ ] [ WEAREDISCOVEREDFLEEATONCEXPDQ ] 4) Now just break the string of letters into easily identifyable 4) Now just break the string of letters into easily identifyable

words, separate the nulls, and the code is decipheredwords, separate the nulls, and the code is deciphered

Page 14: Cryptography

Columnar transpositionColumnar transposition

In a columnar transposition, the message is written In a columnar transposition, the message is written out in rows of a fixed length, and then read out again out in rows of a fixed length, and then read out again column by column, and the columns are chosen in column by column, and the columns are chosen in some scrambled order. some scrambled order.

Both the length of the rows and the permutation of Both the length of the rows and the permutation of the columns are usually defined by a keyword. For the columns are usually defined by a keyword. For example, the word ZEBRAS is of length 6 (so the example, the word ZEBRAS is of length 6 (so the rows are of length 6), and the permutation is defined rows are of length 6), and the permutation is defined by the alphabetical order of the letters in the keyword. by the alphabetical order of the letters in the keyword. In this case, the order would be "6 3 2 4 1 5".In this case, the order would be "6 3 2 4 1 5".

Page 15: Cryptography

Example:Example: suppose we use the keyword ZEBRA and the suppose we use the keyword ZEBRA and the

message WE ARE DISCOVERED. FLEE AT ONCE. message WE ARE DISCOVERED. FLEE AT ONCE. In a regular columnar transposition, we write this into In a regular columnar transposition, we write this into the grid as:the grid as:

6 3 2 4 1 56 3 2 4 1 5W E A R E D W E A R E D I S C O V E I S C O V E R E D F L E R E D F L E E A T O N C E A T O N C E Q K J E U E Q K J E U

Providing five nulls (QKJEU) at the end. The Providing five nulls (QKJEU) at the end. The ciphertext is then read off as:ciphertext is then read off as:

EVLNE ACDTK ESEAQ ROFOJ DEECU WIREEEVLNE ACDTK ESEAQ ROFOJ DEECU WIREE

Page 16: Cryptography

Substitution cipherSubstitution cipher

Substitution cipher is a method of encryption Substitution cipher is a method of encryption by which units of plaintext are substituted with by which units of plaintext are substituted with ciphertext according to a regular system.ciphertext according to a regular system.

Caesar cipher, mono alphabetic substitution, Caesar cipher, mono alphabetic substitution, poly alphabetic substituion. poly alphabetic substituion.

Page 17: Cryptography

Caesar cipherCaesar cipher

In cryptography, a Caesar cipher, also known as a In cryptography, a Caesar cipher, also known as a Caesar's cipher or the shift cipher, is one of the Caesar's cipher or the shift cipher, is one of the simplest and most widely-known encryption simplest and most widely-known encryption techniques. techniques.

It is a type of substitution cipher in which each letter It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed in the plaintext is replaced by a letter some fixed number of positions further down the alphabet. For number of positions further down the alphabet. For example, with a shift of 3, A would be replaced by D, example, with a shift of 3, A would be replaced by D, B would become E, and so on.B would become E, and so on.

Page 18: Cryptography

(Figure showing working of a caesar cipher)

Page 19: Cryptography

Encryption of a letter Encryption of a letter xx by a shift by a shift nn can be can be described mathematically as,described mathematically as,

Decryption is performed similarly,Decryption is performed similarly,

ExampleExample : :

Plaintext : the quick brown fox jumps over the Plaintext : the quick brown fox jumps over the lazy dog.lazy dog.

Ciphertext : WKH TXLFN EURZQ IRA Ciphertext : WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ. MXPSV RYHU WKH ODCB GRJ.

Page 20: Cryptography

Disadvantage:Disadvantage:

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

Page 21: Cryptography

Monoalphabetic cipherMonoalphabetic cipher

A more sophisticated system uses a random series of A more sophisticated system uses a random series of characters for the lower alphabet.characters for the lower alphabet.

e.g : e.g : ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ

IPHBOSFCQZJNTWGLMYRXDKEUVA IPHBOSFCQZJNTWGLMYRXDKEUVAHere the numbers of possible substitutions are Here the numbers of possible substitutions are 403,291,461,126,605,635,584,000,000 for an 403,291,461,126,605,635,584,000,000 for an alphabet of 26 letters. Hence its more complex than alphabet of 26 letters. Hence its more complex than Caesar cipher but still can be broken by some sort of Caesar cipher but still can be broken by some sort of frequency calculation of the alphabets in a cipher frequency calculation of the alphabets in a cipher text. text.

Page 22: Cryptography

Polyalphabetic cipherPolyalphabetic cipher

The polyalphabetic substitution cipher consists The polyalphabetic substitution cipher consists of using several Caesar ciphers in sequence of using several Caesar ciphers in sequence with different shift values.with different shift values.

A PolyAlphabetic Substitution Cipher has: A PolyAlphabetic Substitution Cipher has:

1. A set of related monoalphabetic 1. A set of related monoalphabetic substitution rule. substitution rule.

2.2. A key to determine which particular rule is A key to determine which particular rule is chosen for a given transformation chosen for a given transformation

Page 23: Cryptography

Vigenère cipherVigenère cipher(A polyalphabetic substitution).(A polyalphabetic substitution).

To encrypt a plane text use the following table and To encrypt a plane text use the following table and do the following stepsdo the following steps

Page 24: Cryptography

Steps:Steps: Choose a key.Choose a key. Extract the first letter in the plaintext, p, and the Extract the first letter in the plaintext, p, and the

first letter in the key, qfirst letter in the key, q Use p to select a column in the tableau and q to Use p to select a column in the tableau and q to

select a row in the tableau. The character in the select a row in the tableau. The character in the corresponding cell is the ciphertext charactercorresponding cell is the ciphertext character

Repeat for the second plaintext character, and Repeat for the second plaintext character, and second key letter, and so on. When you come to second key letter, and so on. When you come to the end of the key, you wrap around to the first the end of the key, you wrap around to the first letter of the key.letter of the key.

The length of the key is called the The length of the key is called the period of the period of the cipher.cipher.

Page 25: Cryptography

e.g :e.g :

Plaintext: ATTACKATDAWN Plaintext: ATTACKATDAWN

Key: LEMONLEMONLE Key: LEMONLEMONLE

Ciphertext: LXFOPVEFRNHRCiphertext: LXFOPVEFRNHR

Though it is more complex still it is breakable Though it is more complex still it is breakable by some sort of frequency calculation.by some sort of frequency calculation.

Page 26: Cryptography

Stream cipherStream cipher A Stream Cipher is a symmetric or secret-key encryption A Stream Cipher is a symmetric or secret-key encryption algorithm that encrypts a single bit at a time. With a Stream algorithm that encrypts a single bit at a time. With a Stream Cipher, the same plaintext bit or byte will encrypt to a differentCipher, the same plaintext bit or byte will encrypt to a different

bit or byte every time it is encrypted.bit or byte every time it is encrypted. e.g :e.g : Plain text: pay 100Plain text: pay 100 Binary of plain text: 010111101(hypothetical)Binary of plain text: 010111101(hypothetical) Key: 100101011 ----- perform XOR Key: 100101011 ----- perform XOR

__________________________ __________________________

Cipher text 110010110 ------- ZTU9^%D Cipher text 110010110 ------- ZTU9^%D

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

Page 27: Cryptography

Block cipherBlock cipher

Block cipher technique involves encryption of Block cipher technique involves encryption of one block of text at a time .Decryption also one block of text at a time .Decryption also takes one block of encrypted text at atime. takes one block of encrypted text at atime. Length of the block is usually 64 or 128 bits. Length of the block is usually 64 or 128 bits.

e.g :e.g :

Plain text: four and fivePlain text: four and five

Four and fiveFour and five

Key Key KeyKey Key Key

wvfa ast wvfa --- cipher textwvfa ast wvfa --- cipher text

Page 28: Cryptography

Electronic Codebook Mode (ECB)Electronic Codebook Mode (ECB)

Page 29: Cryptography

The most straightforward way of encrypting a longer The most straightforward way of encrypting a longer plaintext is to use plaintext is to use Electronic Codebook modeElectronic Codebook mode, or , or ECBECB.. Ci=Ek(Pi)for i=1….NCi=Ek(Pi)for i=1….N

Where Pi=plain textWhere Pi=plain text Ci=cipher text.Ci=cipher text. E=encoding alogorithm.E=encoding alogorithm. K=keyK=key N=number of cipher text.N=number of cipher text.

ECB has serious shortcomings:ECB has serious shortcomings: If two plaintext blocks are the same, then the If two plaintext blocks are the same, then the

corresponding ciphertext blocks will be the same, which is corresponding ciphertext blocks will be the same, which is visible to an attacker. Depending on the structure of the visible to an attacker. Depending on the structure of the message, this can leak a lot of information.message, this can leak a lot of information.

It is strongly recommended that ECB not be used for It is strongly recommended that ECB not be used for message encryption.message encryption.

Page 30: Cryptography

Cipher Block Chaining Mode (CBC)Cipher Block Chaining Mode (CBC)

Cipher Block Chaining mode (CBC) avoids Cipher Block Chaining mode (CBC) avoids the problems with ECB by XORing each the problems with ECB by XORing each plaintext block with the previous ciphertext plaintext block with the previous ciphertext block:block:

Ci=Ek(Pi+Ci-1).Ci=Ek(Pi+Ci-1).

Page 31: Cryptography
Page 32: Cryptography

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

Page 33: Cryptography

The primary benefit of public key cryptography is The primary benefit of public key cryptography is that it allows people who have no preexisting that it allows people who have no preexisting security arrangement to exchange messages security arrangement to exchange messages securely. securely.

The need for sender and receiver to share secret The need for sender and receiver to share secret keys via some secure channel is eliminated; all keys via some secure channel is eliminated; all communications involve only public keys, and no communications involve only public keys, and no private key is ever transmitted or shared.private key is ever transmitted or shared.

e.g: RSA algorithm.e.g: RSA algorithm.

Page 34: Cryptography

Digital SignatureDigital Signature

Public key cryptography is also used to Public key cryptography is also used to provide digital signatures.provide digital signatures.

signingsigningplaintextplaintext signed messagesigned message

private keyprivate key

verificationverification signed messagesigned message plaintext plaintext

public keypublic key

Page 35: Cryptography

Transmitting over an insecure Transmitting over an insecure channel.channel.

Alice wants to send Bob a private message.Alice wants to send Bob a private message.

AApublicpublic is Alice’s public key.is Alice’s public key.

AAprivateprivate is Alice’s private key.is Alice’s private key.

BBpublicpublic is Bob’s public key.is Bob’s public key.

BBprivateprivate is Bob’s private key.is Bob’s private key.

Page 36: Cryptography

AliceAlice

decrypt using Bprivate

encrypt using Bpublic

BobBob

Page 37: Cryptography

Bob’s DilemmaBob’s Dilemma

Nobody can read the message from Alice, but Nobody can read the message from Alice, but anyone could produce it.anyone could produce it.

How does Bob know that the message was How does Bob know that the message was really sent from Alice??really sent from Alice??

Page 38: Cryptography

Alice can sign her message!Alice can sign her message!

Alice can create a digital signature and prove Alice can create a digital signature and prove she sent the message (or someone with she sent the message (or someone with knowledge of her private key).knowledge of her private key).

The signature can be a message encrypted with The signature can be a message encrypted with AAprivateprivate..

Bob can decrypt the message digest using Bob can decrypt the message digest using AApublicpublic

Page 39: Cryptography

AliceAlice BobBob

Sign with Aprivate check signature using Apublic

encrypt using Bpublic decrypt using Bprivate

Revised Scheme

Page 40: Cryptography

Advantage of cryptographyAdvantage of cryptography

PPrivacy/Confidentiality: Information rivacy/Confidentiality: Information exchanged between two parties cannot be read exchanged between two parties cannot be read by anyone but the intended recipient by anyone but the intended recipient AAuthentication: The parties exchanging data uthentication: The parties exchanging data can validate each other’s identitiescan validate each other’s identitiesIIntegrity: Information exchanged between two ntegrity: Information exchanged between two parties arrives in tact and unmodifiedparties arrives in tact and unmodifiedNNon-Repudiation: Agreements can be legally on-Repudiation: Agreements can be legally enforced.enforced.

Page 41: Cryptography

BibliographyBibliography

WebsitesWebsiteshttp//en.wikipedia.org/wiki/Cryptographyhttp//en.wikipedia.org/wiki/Cryptographyhttp//www-http//www-cse.ucsd.educse.ucsd.eduhttp//www.cs.berkeley.edu/crypto.htmlhttp//www.cs.berkeley.edu/crypto.html

BooksBooksCryptography and network security – Atul kahteCryptography and network security – Atul kahteCryptography and network security – William Cryptography and network security – William

stallingsstallings

Page 42: Cryptography

Q & A Q & A SessionSession

Page 43: Cryptography

THANK YOUTHANK YOU