You are on page 1of 19

CHAPTER THREE

Cryptography and Encryption Techniques

Elias Debelo
Moyka Mosa

Haramaya Univesity
elias.debelo@haramaya.edu.et
moykad@gmail.com

January 13, 2021


Chapter Outline

1 Introduction

2 Private Key Encryption


Symmetric Cipher Model
Substitution Techniques
Symmetric Block Encryption Algorithms
DES

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 1 / 18
Introduction
Cryptography is a branch of mathematics based on the transformation
of data.
It provides an important tool for protecting information and is used in
many aspects of computer security.

For example, cryptography can help provide data confidentiality, integrity,


electronic signatures, and advanced user authentication.

Cryptography is traditionally associated only with keeping data secret.


However, modern cryptography can be used to provide many security
services, such as electronic signatures and ensuring that data has not
been modified.
Cryptography relies upon two basic components: an algorithm (or
cryptographic methodology)and a key.
In modern cryptographic systems, algorithms are complex
mathematical formulae and keys are strings of bits.
Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 2 / 18
There are two basic types of cryptography: secret key systems (also
called symmetric systems) and public key systems (also called
asymmetric systems)
Symmetric encryption
Symmetric encryption, also referred to as conventional encryption or
single-key encryption, was the only type of encryption in use prior to the
development of public key encryption in the 1970s. It remains by far the
most widely used of the two types of encryption.

Terminologies
1 An original message is known as the plaintext, while the coded
message is called the cipher text.
2 The process of converting from plaintext to cipher text is known as
enciphering or encryption; restoring the plaintext from the cipher text
is deciphering or decryption.
3 The many schemes used for encryption constitute the area of study
known as cryptography.
Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 3 / 18
Terminologies Cont.
1 Such a scheme is known as a cryptographic system or a cipher.
2 Techniques used for deciphering a message without any knowledge of
the enciphering details fall into the area of cryptanalysis.
Cryptanalysis is what the layperson calls “breaking the code.”
3 The areas of cryptography and cryptanalysis together are called
cryptology.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 4 / 18
Cryptographic systems

Cryptographic systems are characterized along three indepen-


dent dimensions:
The type of operations used for transforming plaintext to ciphertext.
All encryption algorithms are based on two general principles:
substitution, in which each element in the plaintext (bit, letter, group
of bits or letters) is mapped into another element, and transposition,
in which elements in the plaintext are rearranged. The fundamental
requirement is that no information be lost (that is, that all operations
are reversible).
Most systems, referred to as product systems, involve multiple stages
of substitutions and transpositions.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 5 / 18
The number of keys used. If both sender and receiver use the same
key, the system is referred to as symmetric, single-key, secret-key, or
conventional encryption. If the sender and receiver use different keys,
the system is referred to as asymmetric, two-key, or publickey
encryption.
The way in which the plaintext is processed. A block cipher processes
the input one block of elements at a time, producing an output block
for each input block. A stream cipher processes the input elements
continuously, producing output one element at a time,as it goes along.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 6 / 18
Private key encryption
(Secret Key)

In secret key cryptography, two (or more) parties share the


same key, and that key is used to encrypt and decrypt data.
As the name implies, secret key cryptography relies on keeping the
key secret. If the key is compromised, the security offered by
cryptography is severely reduced or eliminated.
Secret key cryptography has been in use for centuries.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 7 / 18
Symmetric Cipher Model
A symmetric encryption scheme has five ingredients.

1 Plaintext: This is the original intelligible message or data that is fed


into the algorithm as input.
2 Encryption algorithm: The encryption algorithm performs various
substitutions and transformations on the plaintext.
3 Secret key: The secret key is also input to the encryption algorithm.
The key is a value independent of the plaintext and of the algorithm.
The algorithm will produce a different output depending on the
specific key being used at the time.
4 Cipher text: This is the scrambled message produced as output.It is
an apparently random stream of data and, as it stands, is
unintelligible.
5 Decryption algorithm: This is essentially the encryption algorithm run
in reverse.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 8 / 18
Symmetric encryption Cont.

There are two requirements for secure use of conventional


encryption:

1 We need a strong encryption algorithm. At a minimum, we would like


the algorithm to be such that an opponent who knows the algorithm
and has access to one or more cipher texts would be unable to
decipher the cipher text or figure out the key. This requirement is
usually stated in a stronger form: The opponent should be unable to
decrypt cipher text or discover the key even if he or she is in
possession of a number of cipher texts together with the plaintext
that produced each cipher text.
2 Sender and receiver must have obtained copies of the secret key in a
secure fashion and must keep the key secure. If someone can discover
the key and knows the algorithm, all communication using this key is
readable.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 9 / 18
Symmetric encryption Cont.

Symmetric would look like; Y = E(K, X)

Cypher text Y is produced by using encryption algorithm E as a function of


the plain text, X, with the specific function determined by the value of the
key, K. The intended receiver, in possession of the key, is able to invert the
transformation: X = D(K, Y), where D stands for decryption function.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 10 / 18
Substitution Techniques
A substitution technique is one in which the letters of plaintext are
replaced by other letters or by numbers or symbols.
It is a classical encryption techniques.
Caesar Cipher
The earliest known, and the simplest, use of a substitution cipher was by
Julius Caesar. The Caesar cipher involves replacing each letter of the
alphabet with the letter standing three places further down the alphabet.
Note that the alphabet is wrapped around, so that the letter following Z is A.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 11 / 18
Caesar Cipher
For each plain-text letter P, substitute the cipher text letter C.
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 takes on a value in the range 1 to 25. The decryption algorithm is
simply
p = D (k, C) = (C - k) mod 26

Practice
1 Encrypt ’Hello’ message using Caesar cipher of key = 3

2 How much will it takes to decipher cipher text of caesar cipher?

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 12 / 18
Symmetric Block Encryption Algorithms

The most commonly used symmetric encryption algorithms are block


ciphers. A block cipher processes the plain-text input in
fixed-sized blocks.
A stream cipher processes the input elements continuously, producing
output one element at a time, as it goes along.E.g. Caesar Cipher
The three most important symmetric block ciphers: Data Encryption
Standard (DES), Triple DES (3DES), and Advanced Encryption
Standard (AES).

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 13 / 18
Data Encryption Standard (DES)

In 1973, the NBS (National Bureau of Standards, now called NIST -


National Institute of Standards and Technology) published a request
for an encryption algorithm that would meet the following criteria:
Have a high security level
Be easily understood
Not depend on the algorithm’s confidentiality
Be adaptable and economical
Be efficient
In late 1974, IBM proposed ”Lucifer”, which was then modified by
NSA (National Security Agency) in 1976 to become the DES (Data
Encryption Standard)
DES was then approved by NBS in 1978 and was standardized by ANSI
under the name of ANSI X3.92, also known as DEA (Data Encryption
Algorithm)

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 14 / 18
A block cipher processes the input one block of elements at a time,
producing an output block for each input block.
The key in DES is 56 bits; 8-bit out of the total 64-bit block key is
used for parity check (for example, if odd parity is used, each byte has
an odd number of bits.

DES algorithm involves carrying out combinations, substitutions and


permutations between the text to be encrypted and the key, while
making sure the operations can be performed in both directions (for
decryption)
The combination of substitutions and permutations is called a
product cipher.

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 15 / 18
DES Phases

Data is divided into 64-bit blocks; the key is 56 bits


The processing has three phases

1 Phase 1
The 64-bit plaintext passes through an initial permutation (IP) that
rearranges the bits to produce the permuted input; no elements are
added or deleted or replaced, rather the order in which the elements
appear in the sequence is changed

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 16 / 18
1 Phase 2
1 The 64 bits are then divided into two 32-bit halves called L and R. The
encryption then proceeds through 16 rounds of the same function, each
using the L and R parts, and a subkey
2 In each round, the new L part is simply a copy of the incoming R part.
3 The R and subkeys are processed in the so called f-function, and
exclusive-or of the output of the f-function with the existing L part to
create the new R part.
4 item
2 Phase 3
The preoutput is passed through a permutation that is the inverse of
the initial permutation (IP-1), to produce the 64-bit ciphertext

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 17 / 18
Structure of DES

Elias Debelo Moyka Mosa (HU) Computer Science January 13, 2021 18 / 18

You might also like