Cryptography by Mr. Agbor Anderson

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

CRYPTOGRAPHY BY MR.

AGBOR ANDERSON
Uses of Stream ciphers:

- Converts plain text by assigning a key to one byte one at time.


- Relies onto unpredictability
- It uses XOR for encryption and decryption

Uses of block ciphers:

- Converts plain texts by giving key to a block at a time


- Reversing encryption is hard
- Used to implement large amounts of data.

Crypt analysis and brute-forced attacks

Typically, the objective of attacking an encryption system is to recover the key in-use rather than
simply recover the plain text of a single cipher text. There are 2 general approaches to attacking a
conventional encryption scheme.

1. The Crypt Analysis


The crypt analysis attack relies on the nature of the algorithm plus perhaps, some knowledge
of the general characteristics of the plain text. Or even some sample plain text-cipher text
pairs. This type of attacks exploits the characteristics of the algorithm to attain, to deduce a
specific plain text or to deduce a key being used.
2. Brute force attack
The attacker tries every possible key on a piece of cipher text until an intelligible translation
into plain text is obtained. On average, half of all possible keys must be tried to achieve
success.

If either type of attacks succeeds in deducing the key, the effect is catastrophic. All features and
passed messages encrypted with that key are compromised.

We first consider crypt analysis and then discuss brute force attack.

The most difficult problem is presented when all that is available is the cipher text only. In some
cases, not even the encryption algorithm is known, but in general, we can assume that the opponent
does know the algorithm used for encryption. One possible attack under these circumstances is the
brute force approach of trying all possible keys. If the key space is very large, this becomes
impractical. Thus, the opponent must rely on an analysis of the cipher text itself, generally, applying
various statistical tests to it. To use this in general, if the analyst is able to choose the messages to
encrypt, the analyst may deliberately pick patterns that can be expected to reveal the structure of
the key.

Only relatively weak algorithms fail to withstand a cipher text-only attack. Generally, an encryption
algorithm is designed to withstand a non-plain text attack.

2 more definitions are worthy of note.

- An encryption scheme: is unconditionally secured if the cipher text generated by the scheme
does not contain enough information to determine uniquely the corresponding plain text, no
matter how much cipher text is available. i.e., no matter how much time an opponent has, it
is impossible for him/her to decrypt the cipher text simply because the required information
is not there. With the exception of a scheme known as the one-time pad (described later in
this chapter), there is no encryption algorithm that is unconditionally secured. Therefore, all
that the users of an encryption algorithms can strive for, is an algorithm that meets one or
both of the following criteria:
a. The cost of breaking the cipher exceeds the value of the encrypted information
b. The time requires to break the cipher exceeds the useful lifetime of the information

An encryption scheme is said to be computationally secured if either of the forgoing 2 criteria


are made. Unfortunately, it is very difficult to estimate the amount of efforts required to
crypt-analyze cipher text successfully.

All forms of crypt analysis for symmetric encryption schemes are designed to exploit the facts
that traces of the structures or patterns in the plain text may survive encryption and be
discernible in the cipher text. This will become clear as we examine various symmetric
encryption scheme in this chapter. We will see in part 2 that crypt analysis for public key
schemes proceeds from a fundamentally different premise, namely, that the mathematical
properties of the pairs of keys may make it possible for one of the 2 keys to be deduced from
the other.

The brute force attack involves trying every possible key until an intelligible translation of the
cipher text into plain text is obtained. On average, half of all possible keys must be tried to
achieve success. i.e., it there are X different keys, on average an attacker will discover the
actual key after X/2 tries. It is important to note that there is more to be a brute force attack
than simply running through all possible keys. Unless known plain text is provided, the
analyst must be able to recognize plain text as plain text. If the message is just plain text in
English, then the result pops out easily, although the task of recognizing English would have
to be automated. If the text message has been compressed before encryption, then
recognition is more difficult. And if the message is some more general type of data such as a
numerical file, and this has been compressed, the problem becomes even more difficult to
automate. Thus, to supplement the brute force approach, some degree of knowledge about
the expected plain text is needed and some means of automatically distinguishing plain text
on garble is also needed.

Caesar Cipher algorithm

C = E(K,P) = (P+K)mod26

P = D(K,C) = (C-K)mod26

If it is known that a given cipher text is a Caesar cipher, then a brute force crypt analysis is
easily performed: simply try all the 25 possible keys. In this case, the plain text leaps out as
occupying the 3rd line.

3 important characteristics of this problem enables us to use a brute force crypt analysis.

Playfair Cipher
The best-known multiple letter encryption cipher is the play fair, which treats diagrams in the plain
text as single units and translates these units into cipher text diagrams. The play fair algorithm is
based on the used of 5 by 5 (5X5) matrix of letters constructed using a keyword. Let the keyword be
Monarchy. The matrix is constructed by filling in the letters of the keywords (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 alphabetical order.

The letter I and J count as one letter. Plain text is encrypted 2 letters at a time according to the
following rules:

1. If any letter in the plain text repeats, separate them with the letter X. For example; School
becomes Schoxol.
2. Pair each letter in the plain text into groups of 2’s ignoring white spaces.
3. Create your table using the keyword.
4. Start reading the newly created sentences you got after step 2.
i. If the letters are on the same row of your table, then each letter move a step to the
right e.g., M becomes O, A becomes R.
ii. If they are on the same column, each letter moves a step downwards.
iii. If they appear on different rows and columns, affix a virtual box with 4 sides in such a
way that the 2 letters sit on opposite edges of the box
5. The answer must be on my row not my column.

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
EXAMPLE 2 : some access points are often open = some acxcesxs point are often open

SO ME AC XC ES XS PO IN TS AR EO FT EN OP EN

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

SO ME AC XC ES XS PO IN TS AR EO FT EN OP EN

PA CL MB UB IL AX VH GA LT RM FM KP GM HV GM

EXAMPLE 3: key is RACISM


R A C I/J S

M B D E F

G H K L N

O P Q T U

V W X Y Z

SO ME AC XC ES XS PO IN TS AR EO FT EN OP EN

RU BF CI CD FI ZC QP SL UI CA MT EU FL PQ FL

n/b: Always use X as a filar when its not complete in grouping as 2.

Play fair is symmetric, substitution and is a block cipher

Poly-alphabetic Cipher
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
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 a
c d e f g h i j k l m n o p q r s t u v w x y z a b
d e f g h i j k l m n o p q r s t u v w x y z a b c
e f g h i j k l m n o p q r s t u v w x y z a b c d
f g h i j k l m n o p q r s t u v w x y z a b c d e
g h i j k l m n o p q r s t u v w x y z a b c d e f
h i j k l m n o p q r s t u v w x y z a b c d e f g
i j k l m n o p q r s t u v w x y z a b c d e f g h
j k l m n o p q r s t u v w x y z a b c d e f g h i
k l m n o p q r s t u v w x y z a b c d e f g h i j
l m n o p q r s t u v w x y z a b c d e f g h i j k
m n o p q r s t u v w x y z a b c d e f g h i j k l
n o p q r s t u v w x y z a b c d e f g h i j k l m
o p q r s t u v w x y z a b c d e f g h i j k l m n
p q r s t u v w x y z a b c d e f g h i j k l m n o
q r s t u v w x y z a b c d e f g h i j k l m n o p
r s t u v w x y z a b c d e f g h i j k l m n o p q
s t u v w x y z a b c d e f g h i j k l m n o p q r
t u v w x y z a b c d e f g h i j k l m n o p q r s
u v w x y z a b c d e f g h i j k l m n o p q r s t
v w x y z a b c d e f g h i j k l m n o p q r s t u
w x y z a b c d e f g h i j k l m n o p q r s t u v
x y z a b c d e f g h i j k l m n o p q r s t u v w
y z a b c d e f g h i j k l m n o p q r s t u v w x
z 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
Block Cipher
After studying this chapter, you should be able to tell clearly the difference between stream cipher
and block cipher. Several important symmetric block encryption algorithms are currently in use, and
they are based on a structured referred to as a Feistel block cipher. For this reason, it is important to
examine the design principle of the Feistel cipher. We begin with the comparism of stream ciphers
and block ciphers. Then we later discuss the motivation behind the Feistel cipher and some of its
implementation.

Stream and Block ciphers

A stream cipher is one that encrypts a digital data stream one bit/byte at a time. Example of classical
stream ciphers include: the Vernam cipher (h/w) and the one-time pad (in which the key stream is
as long as the plain text stream). If the cryptographic key is random, then this cipher is practically
unbreakable by any means other than acquiring the key. However, this generated key stream must
be provided to both users in advance via some independent and secure channels. This introduces a
very huge amount of logistic problems if the intended data traffic is very large. Accordingly, for
practical reasons the bit stream generator must be implemented as an algorithmic procedure, so that
the cryptographic bit stream can be produced by both users. In this approach, the bit stream
generator is a key control algorithm which must produce a very strong cryptographic stream (key)

You might also like