Download as pdf or txt
Download as pdf or txt
You are on page 1of 108

Cryptography and

System Security
What is cryptography and system security?
Cryptography provides for secure
communication in the presence of
malicious third-parties—known as
adversaries. Encryption uses an algorithm
and a key to transform an input (i.e.,
plaintext) into an encrypted output (i.e.,
ciphertext).
Security Goals
Active Attacks
Active attacks involve some modification of the data
stream or the creation of a false stream
Four categories:
◦ masquerade,
◦ replay,
◦ modification of messages,
◦ denial of service.
Passive Attacks
Difference between Active and Passive
Attack
ITU identified five services that are
linked to security goals and attacks.
Model for Network Security
Modular Arithmatic
Classical Cryptography
Classical cryptography is based on the mathematics
and it relies on the computational difficulty of
factorizing large number.

The security of classical cryptography is based on the


high complexity of the mathematical problem for the
instance factorization of large number.
⚫ 1. Plain Text (x): This is the original data/message that is
to be communicated to the receiver by the sender. It is one
of the inputs to the encryption algorithm.

⚫ 2. Secret Key (k): It is a value/string/textfile used by the


encryption and decryption algorithm to encode and
decode the plain text to cipher text and vice-versa
respectively.
It is independent of the encryption algorithm.
It governs all the conversions in plain text.
All the substitutions and transformations done depend
on the secret key.

⚫ 3. Encryption Algorithm (E): It takes the plain text and


the secret key as inputs and produces Cipher Text as
output. It implies several techniques such as substitutions
and transformations on the plain text using the secret key.
E(x, k) = y
⚫ 4.Cipher Text (y): It is the formatted form of the
plain text (x) which is unreadable for humans, hence
providing encryption during the transmission. It is
completely dependent upon the secret key provided to
the encryption algorithm. Each unique secret key
produces a unique cipher text.

⚫ 5. Decryption Algorithm (D): It performs reversal of


the encryption algorithm at the recipient’s side. It also
takes the secret key as input and decodes the cipher
text received from the sender based on the secret key.
It produces plain text as output.
D(y, k) = x
⚫ Classical Cryptography has two types of
techniques:

⚫ Symmetric Cryptography

⚫ Asymmetric Cryptography
Symmetric Cryptography:

In the symmetric cryptography a single key is used


for encrypting and decryption the data.
This encryption key is private key.
This is the limitation of this encryption technique
that this private key must be distributed only
among the authorized sender and receiver.
Asymmetric Cryptography:

In the asymmetric cryptography a pair of key, i.e.,


public key and private key is used for encryption
and decryption.
A sender can use its public key to encrypt the data
and on receiver end receiver can decrypt the data
by using its private key.
This technique overcomes the problem of key
distribution.
Symmetric Cipher Model

⚫ Symmetric Encryption is the most basic and old


method of encryption. It uses only one key for the
process of both the encryption and decryption of data.
Thus, it is also known as Single-Key Encryption.
Requirements for Encryption:
There are only two requirements that need to be met
to perform encryption. They are,
⚫ 1. Encryption Algorithm: There is a need for a very
strong encryption algorithm that produces cipher texts
in such a way that the attacker should be unable to
crack the secret key even if they have access to one or
more cipher texts.
⚫ 2. Secure way to share Secret Key: There must be a
secure and robust way to share the secret key between
the sender and the receiver. It should be leakproof so
that the attacker cannot access the secret key.
Monoalphabetic and Polyalphabetic Cipher
⚫ 1. Monoalphabetic Cipher :
A monoalphabetic cipher is any cipher in which the
letters of the plain text are mapped to cipher text
letters based on a single alphabetic key.
⚫ Examples of monoalphabetic ciphers would include
the Caesar-shift cipher, where each letter is shifted
based on a numeric key.
⚫ 2. Polyalphabetic Cipher :
A polyalphabetic cipher is any cipher based on
substitution, using multiple substitution alphabets.
⚫ eg. The Vigenère cipher is probably the best-known
example of a polyalphabetic cipher, though it is a
simplified special case.
Difference between Monoalphabetic Cipher and
Polyalphabetic Cipher
Vigenère Cipher
⚫ Encryption:
⚫ The first letter of the plaintext, G is paired with A, the
first letter of the key. So use row G and column A of the
Vigenère square, namely G. Similarly, for the second
letter of the plaintext, the second letter of the key is
used, the letter at row E, and column Y is C. The rest of
the plaintext is enciphered in a similar fashion.
⚫ Decryption:

Decryption is performed by going to the row in the


table corresponding to the key, finding the position of
the ciphertext letter in this row, and then using the
column’s label as the plaintext.
For example,
In row A (from AYUSH), the ciphertext G appears in
column G, which is the first plaintext letter. Next, we
go to row Y (from AYUSH), locate the ciphertext C
which is found in column E, thus E is the second
plaintext letter.
⚫ A more easy implementation could be to visualize
Vigenère algebraically by converting [A-Z] into numbers
[0–25].
Encryption
The plaintext(P) and key(K) are added modulo 26.
Ei = (Pi + Ki) mod 26
Decryption
Di = (Ei - Ki + 26) mod 26
⚫ Note: Di denotes the offset of the i-th character of the
plaintext. Like offset of A is 0 and of B is 1 and so on.
Transposition Cipher
Transposition Cipher is a cryptographic
algorithm where the order of alphabets in the
plaintext is rearranged to form a cipher text.
In this process, the actual plain text
alphabets are not included.
Example
A simple example for a transposition cipher
is columnar transposition cipher where
each character in the plain text is written
horizontally with specified alphabet width.
The cipher is written vertically, which creates
an entirely different cipher text.

Consider the plain text hello world, and let


us apply the simple columnar transposition
technique as shown below
The plain text characters are placed
horizontally and the cipher text is created
with vertical format as : holewdlolr.
Cipher Text:- ( ie. HOLEWDLOIR)
Now, the receiver has to use the same table to
decrypt the cipher text to plain text.
A transposition cipher does not substitute
one symbol for another (as in substitution
cipher), but changes the location of these
symbols.

It reorders (jumbles) the given plain-text to


give the cipher-text.

They are of two types:


1. Keyed Transposition Cipher.
2. Keyless Transposition Cipher.
Keyless Transportation cipher is simple one
which does not required key (ie. Keyless).
In first method the text is written into a table
column by column and then transmitted row
by row.
In the second method the text is written into
the table row by row and then transmitted
column by column.

Example of a Keyless transposition cipher


using first method is rail fence cipher.
Example- Encrypt: NOTHING IS AS IT SEEMS
First write it on two lines in a zig-zag pattern
(or rail fence). The cipher text is produced by
transcribing the first row followed by the
second row.

Cipher text: NTIGS STEMO HNIAI SES

To decrypt, write half the letters on one line, half on


the second.
Keyed Transposition cipher

In this approach, rather than permuting all


the symbols together, we divide the entire
plaintext into Rectangle of
predetermined size and then permute it
as per the key. The last character used to
complete the block size is a dummy character
(ie. X, Yor Z).
Size of the column in a Rectangle depends
on the size of key .
Key can be numeric or alphabetic but every
number or alphabet in a key should be
unique.
Difference between Substitution Cipher and Transposition
Cipher

You might also like