0% found this document useful (0 votes)
119 views10 pages

1st Lecture

The document discusses cryptography and cryptanalysis. It defines cryptography as the design of secret communication systems and cryptanalysis as the study of breaking secret communication systems. The document then discusses symmetric and asymmetric cryptography. It provides examples of simple monoalphabetic and polyalphabetic substitution ciphers like the Caesar cipher and Playfair cipher.

Uploaded by

AHMED DARAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views10 pages

1st Lecture

The document discusses cryptography and cryptanalysis. It defines cryptography as the design of secret communication systems and cryptanalysis as the study of breaking secret communication systems. The document then discusses symmetric and asymmetric cryptography. It provides examples of simple monoalphabetic and polyalphabetic substitution ciphers like the Caesar cipher and Playfair cipher.

Uploaded by

AHMED DARAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

SECURITY OF C.N.

BY: Assist.lec. AHMED K. DARAJ

1
C.N. Security lec 1 ENG. AHMED K. DARAJ

Cryptography: is probably the most important aspect of communications security and is


becoming increasingly important as a basic building block for computer security.

Cryptology is the science and study of systems for secret communications. It consists of two
complementary fields of study: Cryptography, the design of secret communications systems,
and Cryptanalysis, the study of ways to compromise of secret communications systems.

Cryptography methods applied by authorized information sharers to design and develop


encryption schemes in order to ensure confidentiality of information.

Crypt-Analysis (mathematical and statistical attempts by unauthorized persons to break cipher


in order to reveal the meaning of the underlying protected data).

Cryptography: It is the study of mathematical techniques related to aspects of information


security such as:-

• Confidentiality is the concealment of information or resources.

• Authenticity is the identification and assurance of the origin of information.

• Integrity refers to the trustworthiness of data or resources in terms of preventing


improper and unauthorized changes.

• Availability refers to the ability to use the information or resource desired.

• Non-repudiation It implies that one party of a transaction cannot deny having received
a transaction, nor can the other party deny having sent a transaction.
C.N. Security lec 1 ENG. AHMED K. DARAJ

Cryptography classified into two types:

1- Symmetric

2- Asymmetric

A Symmetric cryptography ciphers may in fact be sub classified into Block Ciphers (in
which blocks of data, known as plaintext, are transformed into cipher text which appears
unintelligible to unauthorized persons) and Stream Ciphers (which involve streams of typically
binary operations and are well suited for efficient computer implementation) as shown in figure
1-1.

Symmetric Ciphers
In Symmetric cryptography ciphers the enciphering and deciphering keys are the same, as
shown in figure 1-2:

Fig. 1-2: Secret Writing


C.N. Security lec 1 ENG. AHMED K. DARAJ

Plaintext: This is the original intelligible message or data that is fed into the algorithm as input.

Ciphertext: This is the scrambled message produced as output. It depends on the plaintext and
the secret key. The ciphertext is an apparently random stream of data and, as it stands,
is unintelligible.

Secret key: The secret key is also input to the encryption algorithm. The key is a value
independent of the plaintext and the algorithm. The algorithm will produce a different
output depending on the specific key being used at the time. The exact substitutions
and transformations performed by the algorithm depend on the key.

A Symmetric cryptography ciphers may in fact be sub classified into:

1. Block Cipher: processes the input one block of elements at a time, producing an output
block for each input block.
2. Stream Cipher: processes that encrypt a digital data stream one bit or one byte at a time.

The process of transforming plaintext into ciphertext is called Encryption; the reverse
process of transforming ciphertext into plaintext is called Decryption.

Encryption algorithm: The encryption algorithm performs various substitutions and


transformations on the plaintext.

Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes the
ciphertext and the secret key and produces the original plaintext.

Block: A sequence of consecutive characters encoded at one time.

Block length: The number of characters in a block.

An algorithm for performing encryption (and the reverse, decryption): a series of well-defined
steps that can be followed as a procedure. It works at the level of individual letters, or small
groups of letters.

Cryptosystem: The package of all processes, formulae, and instructions for encoding and
decoding messages using cryptography
Digram: Sequence of two consecutive characters
C.N. Security lec 1 ENG. AHMED K. DARAJ

Key: A relatively small amount of information that is used by an algorithm to customize the
transformation of plaintext into ciphertext (during encryption) or vice versa (during
decryption)
Key length: The size of the key - how many values comprise the key
Monoalphabetic: Using one alphabet - refers to a cryptosystem where each alphabetic character
is mapped to a unique alphabetic character
Polyalphabetic: Using many alphabets - refers to a cipher where each alphabetic character can
be mapped to one of many possible alphabetic characters
Trigram: Sequence of three consecutive characters unigram

Caesar cipher

The earliest known use of a substitution cipher, and the simplest, was by Julius Caesar.
The Caesar cipher involves replacing each letter of the alphabet with the letter standing three
places further down the alphabet. For example:

Plain: m eet me after the toga party Cipher: P HHW PH DIWHU WKH WRJD SDUWB

Each letter location shifted 3 locations for example: m =12 so 12+3= 15 that mean (P)
Let us assign a numerical equivalent to each letter:

A B C D E F G H I J K L M
0 1 2 3 4 5 6 7 8 9 10 11 12
N O P Q R S T U V W X Y Z
13 14 15 16 17 18 19 20 21 22 23 24 25

Then the algorithm can be expressed as C = E(3, p) = (p + 3) mod 26


A shift may be of any amount, so that the general Caesar algorithm is
C = E(k, p) = (p + k) mod 26
where k takes on a value in the range 1 to 25. The decryption algorithm is simply
p = D(k, C) = (C - k) mod 26
C.N. Security lec 1 ENG. AHMED K. DARAJ

Example: encrypt the following message using Caesar cipher:


Ship equipment will reach on the fourth of July
C = (p + k) mod 26

c(1) = 18+3 mod 26 = 21 c(2) = 7+3 mod 26 =10 c(3) = 8+3 mod 26 = 11

c(39) = 24+3 mod 26 = 1

cipertexe: VKLSHTXLSPHQWZLOOUHDFKRQWKHIRXUWKRIMXOB

Example: decrypt the following message (NHBZRUG) using Caesar cipher:

p = (C - k) mod 26 p1= (13-3) mod 26=10➔k p2= (7-3) mod 26=4➔e

p3= (1-3) mod 26=24➔y p4= (25-3) mod 26=22➔w p5= (17-3) mod 26=14➔o p6= (20-3)
mod 26=17➔r p7= (6-3) mod 26=3➔d then the plaintext is keyword

The two basic building blocks of all encryption techniques are substitution and
transposition:

Substitution technique is one in which the letters of plaintext are replaced by other letters or
by numbers or symbols.
1. Monoalphabetic: Using one alphabet - refers to a cryptosystem where each alphabetic
character is mapped to a unique alphabetic character.
2. Polyalphabetic: Using many alphabets - refers to a cipher where each alphabetic
character can be mapped to one of many possible alphabetic characters.

Cryptosystem: The package of all processes, formulae, and instructions for encoding and
decoding messages using cryptography.

Transposition technique is a very different kind of mapping is achieved by performing some


sort of permutation on the plaintext letters.
C.N. Security lec 1 ENG. AHMED K. DARAJ

Simple Monoalphabetic Substitution Cipher

The simple substitution cipher is a cipher that has been in use for many hundreds of years.
It basically consists of substituting every plaintext character for a different ciphertext character.
It differs from the Caesar cipher in that the cipher alphabet is not simply the alphabet shifted, it
is completely jumbled.

Example : Encrypt the following text: "defend the east wall of the castle".

Keys for the simple substitution cipher usually consist of 26 letters (compared to the
caeser cipher's single number). An example key is:

Plain Text Character:-

a b c d e f g h i j k l m n o p q r s t u v w x y z

Cipher Text Character ( key cipher)

P H Q G I U M E A Y L N O F D X J K R C V S T Z W B

An example encryption using the above key:

Plaintext: defend the east wall of the castle

Ciphertext: GIUIFGCEIIPRCTPNNDUCEIQPRCNI
C.N. Security lec 1 ENG. AHMED K. DARAJ

Example 2:

Plain Text Character:-

a b c d e f g h i j k l m n o p q r s t u v w x y z

Cipher Text Character (key cipher):-

H W U G C T V A E K D Y Q P B R J L F I X M S O Z N

Let the Plaintext = "dulce et decorm est pro patria mori"

Now the cipher text is (GXYUCCIGCUBLXQCFIRLBRHILEHQBLE)

Note: - Remove all spaces, special characters in plain text

Playfair Cipher

The Playfair algorithm is based on the use of a 5 x 5 matrix of letters constructed using a
keyword. The matrix is constructed by filling in the letters of the keyword (minus duplicates)
from left to right and from top to bottom, and then filling in the remainder of the matrix with
the remaining letters in alphabetic order. The letters I and J count as one letter.

If the keyword is monarchy then:

M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
C.N. Security lec 1 ENG. AHMED K. DARAJ

Plaintext is encrypted two letters at a time, according to the following rules:

1. Repeating plaintext letters that are in the same pair are separated with a filler letter, such as
x, so that balloon would be treated as ba lx lo on.
2. Two plaintext letters that fall in the same row of the matrix are each replaced by the letter
to the right, with the first element of the row circularly following the last. For example, ar
is encrypted as RM.
3. Two plaintext letters that fall in the same column are each replaced by the letter beneath,
with the top element of the column circularly following the last. For example, mu is
encrypted as CM.
4. Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and
the column occupied by the other plaintext letter. Thus, hs becomes BP and ea becomes
IM (or JM, as the encipherer wishes).
Example: Encrypt the following message: “Why, don’t you?” using the keyword: "keyword"

K E Y W O

R D A B C

F G H I/ J L

M N P Q S

T U V X Z
wh yd on ty ou

YJ EA ES VK EZ

Then Ciphertexet is : YJEAESVKEZ.


C.N. Security lec 1 ENG. AHMED K. DARAJ

Example: Decrypt the message (PH GK CN HR FA NY) using playfair cipher with the
key=encrypt.

Solution: convert the key to 5x5 matrix


e n c r y
PH➔ af p t a b d

GK➔ fi f g h i/j k
l m o q s
CN➔ ne
u v w x z
RH➔ ci

AF➔ ph

NY➔ er then the plaintext is affine cipher

You might also like