FEU Cryptography

26
ITIE533 –NETWORK SECURITY

description

hfhdfhdfh

Transcript of FEU Cryptography

Page 1: FEU Cryptography

ITIE533 –NETWORK SECURITY

Page 2: FEU Cryptography

Cryptology The art and science of making and breaking “secret codes”

Cryptography making “secret codes”

Cryptanalysis breaking “secret codes”

Crypto all of the above (and more)

Page 3: FEU Cryptography

plaintext - original message ciphertext - coded message cipher - algorithm for transforming plaintext to

ciphertext key - info used in cipher known only to

sender/receiver encipher (encrypt) - converting plaintext to

ciphertext decipher (decrypt) - recovering ciphertext

from plaintext

Page 4: FEU Cryptography

In symmetric-key cryptography, the same key is used by the sender (for encryption) and the receiver (for decryption). The key is shared.

Page 5: FEU Cryptography

plaintextmessage, m

ciphertextencryptionalgorithm

decryption algorithm

Bob’s public key

plaintextmessage

K (m)B+

K B+

Bob’s privatekey

K B-

Page 6: FEU Cryptography

The Caesar cipher is one of the earliest known and simplest ciphers.

The Caesar cipher is named for Julius Caesar, who allegedly used it to protect messages of military significance.

It is a type of substitution cipher in which each letter in the plaintext is 'shifted' a certain number of places down the alphabet.

Page 7: FEU Cryptography

To pass an encrypted message from one person to another, it is first necessary that both parties have the 'key’ for the cipher, so that the sender may encrypt it and the receiver may decrypt it.

For the Caesar cipher, the key(k) is the number of characters to shift the cipher alphabet.

Page 8: FEU Cryptography

First we translate all of our characters to numbers, 'a'=0, 'b'=1, 'c'=2, ... , 'z'=25. We can now represent the caesar cipher encryption function, E(x), where x is the character we are encrypting, as:

E(x) = (x + k) mod 26 Where k is the key (the shift) applied to

each letter. (In the above, the result is in the range

0...25. I.e., if x+n or x-n are not in the range 0...25, we have to subtract or add 26.)

Page 9: FEU Cryptography

After applying this function the result is a number which must then be translated back into a letter. The decryption function is :

D(x) = (x - k) mod 26Example: k=1

plaintext : defend the east wall of the castle ciphertext: efgfoe uif fbtu xbmm pg uif dbtumf

Page 10: FEU Cryptography

Atbash is an ancient encryption system created in the Middle East.

It was originally used in the Hebrew language.

The Atbash cipher is a simple substitution cipher that relies on transposing all the letters in the alphabet such that the resulting alphabet is backwards.

The first letter is replaced with the last letter, the second with the second-last, and so on.

Page 11: FEU Cryptography

Plaintext: moneyCiphertext: nlmvb

Page 12: FEU Cryptography

To encode a message, each letter of the plaintext is replaced by a group of five of the letters 'A' or 'B'. This replacement is done according to the alphabet of the Baconian cipher, shown below.

Page 13: FEU Cryptography

Plaintext: insertion

Ciphertext:

ABAAA ABBAA BAAAB AABAA BAAAA BAABA ABAAA ABBAB ABBAA

Page 14: FEU Cryptography

Applying ROT13 to a piece of text merely requires examining its alphabetic characters and replacing each one by the letter 13 places further along in the alphabet, wrapping back to the beginning if necessary. A becomes N, B becomes O, and so on up to M, which becomes Z, then the sequence continues at the beginning of the alphabet: N becomes A, O becomes B, and so on to Z, which becomes M. 

Page 15: FEU Cryptography

Plaintext: insertionCiphertext: vafregvba

Page 16: FEU Cryptography

A Polybius Square is a table that allows someone to translate letters into numbers. To give a small level of encryption, this table can be randomized and shared with the recipient. In order to fit the 26 letters of the alphabet into the 25 spots created by the table, the letters i and j are usually combined. 

Page 17: FEU Cryptography

Plain: insertion (CR approach)Cipher:423334512444424333

Page 18: FEU Cryptography

A transposition cipher is a method of encryption by which the positions held by units of plaintext(which are commonly characters or groups of characters) are shifted according to a regular system, so that the ciphertext constitutes a permutation of the plaintext. That is, the order of the units is changed.

Page 19: FEU Cryptography

Plaintext: ILOVEYOUWhere:f(position) – indicates the position of

each character in the plain textfe(position) – produces a permutation of

the given plain text I L O V E Y O U 1 3 4 2 1 3 4 2 2 4 3 1 2 4 3 1Given the encryption function

fe(2,4,3,1), the ciphertext is VOLIUOYE

Page 20: FEU Cryptography

In 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 width of the rows and the permutation of the columns are usually defined by a function.

Page 21: FEU Cryptography

Plaintext: CRYPTOGRAPHY There are 12 characters. It may be

filled in a table that has 3rows by 4 columns.

Any spare spaces are filled with nulls or special characters.

3 4 1 2

C R Y P

T O G R

A P H Y

Page 22: FEU Cryptography

f(3,4,1,2) is the encryption function.Given the encryption function

fe(2,4,3,1), the ciphertext is PRYROPCTAYGH.

Page 23: FEU Cryptography

1.Using CAESAR CIPHER, decrypt the following message using k = 7:

RLLWP UNAOL SLNHJ FVMOV WLHUK ZLYCP JL

2.Using ATBASH, decrypt the following message: 

PVIMV ORHGS VXLIV LULKV IZGRM THBHG VNH

Page 24: FEU Cryptography

3. Using TRANSPOSITION OF CHARACTERS, obtain the original information from the given cipher text. Given: fe (3, 2, 1, 5, 4) f (1, 5, 4, 3, 2) TIGRAE-TUDNOIS-NLT-OHEY-TEA-GRT-TESVIOF-ESRTU T- -BU-PTHENTARE-A-OFTHLL-IRE-VS-TUE

Page 25: FEU Cryptography

4. Using ROT13, obtain the original message from the given cipher text.

 VG GNXRF ENVA NAQ FHAFUVAR

5. Using POLYBIUS SQUARE, obtain the original message from the given cipher text. 44 43 23 11 52 51 11 24 11 42

33 21 43 25

Page 26: FEU Cryptography