Sunteți pe pagina 1din 26

ITIE533 NETWORK SECURITY

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)

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

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

+ Bobs public B key

K - Bobs private B key

plaintext message, m

encryption algorithm

ciphertext K+ (m)
B

decryption algorithm

plaintext message

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.

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.

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.)

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 26 Example: k=1
plaintext : defend the east wall of the castle ciphertext: efgfoe uif fbtu xbmm pg uif dbtumf

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.

Plaintext: money Ciphertext: nlmvb

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.

Plaintext: Ciphertext:

insertion ABAAA ABBAA BAAAB AABAA BAAAA BAABA ABAAA ABBAB ABBAA

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.

Plaintext: insertion Ciphertext: vafregvba

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.

Plain: insertion (CR approach) Cipher:423334512444424333

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.

Plaintext: ILOVEYOU Where: f(position) indicates the position of each character in the plain text fe(position) produces a permutation of the given plain text I L O V EY O U 1342 1342 2431 2431 Given the encryption function fe(2,4,3,1), the ciphertext is VOLIUOYE

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.

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 C T A 4 R O P 1 Y G H 2 P R Y

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

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

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-GRTTESVIOF-ESRTU T- -BU-PTHENTARE-AOFTHLL-IRE-VS-TUE

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

S-ar putea să vă placă și