CH 2 IS
CH 2 IS
CH 2 IS
Data Integrity: Assures that information and programs are changed only in specified and authorize manner.
System Integrity: Assures that a system performs its intended function in an unimpaired manner, free from
deliberate or inadvertent unauthorized manipulation of the system.
3. Availability: Assures that systems work promptly and service is not denied to authorize user.
•Threat: A potential for violation of security, which exists when there is a circumstance, capability,action,
or event that could breach security and cause harm. That is, a threat is a possible danger that might
exploit vulnerability.
Security services
A security service is a processing or communicating service that can prevent or detect the various
attacks. Various security services are:
o Authentication: the recipient should be able to identify the sender, and verify that the sender,
who claims to be the sender, actually did send the message.
o Data Confidentiality: An attacker should not be able to read the transmitted data or extract data in
case of encrypted data. In short, confidentiality is the protection of transmitted data from passive
attacks.
o Data Integrity: Make sure that the message received was exactly the message the sender sent.
o No repudiation: The sender should not be able to deny sending the should not be able to deny receiving
the message.message.The receiver should no be able to deny receiving the message.
Cryptography
An original message is known as the plaintext.
The Coded message is called the ciphertext.
1
Unit II : Symmetric and Asymmetric Encryption Algorithms
Symmetric encryption is a form of cryptosystem in which encryption and decryption are performed using the
same key.
It is also known as conventional encryption.
Symmetric encryption transforms plaintext into cipher text using a secret key and an encryption algorithm.
Using the same key and a decryption algorithm, the plaintext is recovered from the cipher text.
A symmetric encryption scheme has five ingredients
o Plaintext: This is the original intelligible message or data that is fed into the algorithm as input.
o Encryption algorithm: The encryption algorithm performs various substitutions and transformations
on the plaintext.
o 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.
o 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.
o Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes the
ciphertext and the secret key and produces the original plaintext.
2
Unit II : Symmetric and Asymmetric Encryption Algorithms
3
Unit II : Symmetric and Asymmetric Encryption Algorithms
4
Unit II : Symmetric and Asymmetric Encryption Algorithms
Substitution Techniques
It is one in which the letters of plaintext are replaced by other letters or by numbers or symbols.
Caesar cipher
The encryption rule is simple; replace each letter of the alphabet with the letter standing 3 places
further down the alphabet.
The alphabet is wrapped around so that Z follows A.
Generally Plain text is in lower case and Cipher text is Upper Case.
Example:
Plaintext: meet me after the party
Ciphertext: PHHW PH DIWHU WKH SDUWB
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
Here, the key is 3. If different key is used, different substitution will be obtained.
Mathematically, starting from a=0, b=1 and so on, Caesar cipher can be written as:
E(P) = ( P + K ) mod (26)
D(C) = (C – K) mod (26)
Example2:
5
Unit II : Symmetric and Asymmetric Encryption Algorithms
6
Unit II : Symmetric and Asymmetric Encryption Algorithms
7
Unit II : Symmetric and Asymmetric Encryption Algorithms
Playfair Cipher
In this technique multiple (2) letters are encrypted at a time.
This technique uses a 5 X 5 matrix which is also called key matrix.
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
8
Unit II : Symmetric and Asymmetric Encryption Algorithms
Strength of playfair cipher Playfair cipher is a great advance over simple mono alphabetic ciphers. Since there are 26
letters, 26x26 = 676 diagrams are possible, so identification of individual diagram is more difficult.
Hill Cipher
This cipher is based on linear algebra.
Where C and P are row vectors of length 3 representing the plaintext and cipher text, and K is a 3 X 3
matrix representing the encryption key
Key is an invertible matrix K modulo 26, of size m. For example:
17 17 5 4 19 15
𝐾 = (21 18 21) 𝐾−1 = (15 17 6 )
2 2 19 24 0 17
Encryption and decryption can be given by the following formulae:
Encryption: 𝐶 = 𝑃𝐾 𝑚o𝑑 26
Decryption: 𝑃 = 𝐶𝐾−1 𝑚o𝑑 26
9
Unit II : Symmetric and Asymmetric Encryption Algorithms
The strength of the Hill cipher is that it completely hides single-letter frequencies.
Although the Hill cipher is strong against a cipher text-only attack, it is easily broken with a known
plaintext attack.
o Collect m pair of plaintext-cipher text, where m is the size of the key.
o Write the m plaintexts as the rows of a square matrix P of size m.
o Write the m cipher texts as the rows of a square matrix C of size m.
o We have that C=PK mod 26.
o If P is invertible, then K=P-1C mod 26,
o If P is not invertible, then collect more plaintext-cipher text pairs until an invertible P is obtained.
Vernam Cipher
This system works on binary data (bits) rather than letters.
The technique can be expressed as follows:
𝐶i= 𝑃i ⊕ 𝐾i
Where
𝑃i = ith binary digit of plaintext.
𝐾i = ith binary digit of key.
𝐶i = ith binary digit of ciphertext.
⊕ = exclusive-or (XOR) operation
Thus, the ciphertext is generated by performing the bitwise XOR of the plaintext and the key.
Decryption simply involves the same bitwise operation:
𝑃i= 𝐶i ⊕ 𝐾i
The essence of this technique is the means of construction of the key.
It was produced by the use of a running loop of tape that eventually repeated the key, so that in fact the
system worked with a very long but repeating keyword.
10
Unit II : Symmetric and Asymmetric Encryption Algorithms
Although such a scheme has cryptanalytic difficulties, but it can be broken with a very long ciphertext or
known plaintext as the key is repeated.
One-Time Pad
In this scheme, a random key that is as long as the message is used.
The key is used to encrypt and decrypt a single message, and then is discarded. Each new message
requires a new key of the same length as the new message.
This scheme is unbreakable.
It produces random output that bears no statistical relationship to the plaintext.
Because the ciphertext contains no information whatsoever about the plaintext, there is simply no way
to break the code.
For any plaintext of equal length to the ciphertext, there is a key that produces that plaintext.
Therefore, if you did an exhaustive search of all possible keys, you would e d up with many legible
plaintexts, with no way of knowing which the intended plaintext was.
Therefore, the code is unbreakable.
The security of the one-time pad is entirely due to the randomness of the key.
The one-time pad offers complete security but, in practice, has two fundamental difficulties:
o There is the practical problem of making large quantities of random keys. Any heavily used system
might require millions of random characters on a regular basis. Supplying truly random characters in
this volume is a significant task.
o Another problem is that of key distribution and protection. For every message to be sent, a key of
equal length is needed by both sender and receiver.
Because of these difficulties, the one-time pad is used where very high security is required.
The one-time pad is the only cryptosystem that exhibits perfect secrecy.
Transposition Techniques
A very different kind of mapping is achieved by performing some sort of permutation on the plaintext
letters. This technique is referred to as a transposition cipher.
The simplest such cipher is the rail fence technique.
m e m a t r h p r y
e t e f e t e o a t
11