CSS 2025 Module 1 Introduction (1)
CSS 2025 Module 1 Introduction (1)
Tasneem Mirza
Cryptography, which translates as "secret
writing," refers to the science of concealing the
meaning of data so only specified parties
understand a transmission's contents.
Network security consists of the policies and
practices adopted to prevent and monitor
unauthorized access, misuse, modification, or
denial of a computer network.
3 valuable components of a computer based
system :
Hardware
Software
Data
parties.
Modifications includes changing, deleting and
creating.
3. Availability :
If a person has legitimate access to a particular
2. Interception.
Read or listen to the message thereby affecting
the confidentiality of the message
3. Modification
An unauthorized party(O) not only gains access but
Threatens integrity
4. Fabrication
Fabricate an authentic looking message arranging for
S R S R
O O
◦ Hackers :
A computer enthusiast as an individual who enjoys
exploring the details of computers and how to
stretch their capabilities, as opposed to most users
who prefer to learn only the minimum necessary.
◦ Crackers :
replay/send it.
For example: A person sends a request to his bank to ask for payment to the
attacker, who had done a job for him. The attacker intercept the message and sends
it again to cause another payment from the Bank.
In a replay attack, it doesn't matter if the attacker who intercepted the original
message can read or decipher the key. All he or she has to do is capture and resend
the entire thing
One method to avoid becoming a victim is to have a password for each transaction
messages. This prevents hackers from resending messages sent longer ago than a
certain length of time, thus reducing the window of opportunity for an attacker to
eavesdrop.
Another method to avoid becoming a victim is to have a password for each
.
d) Repudiation
The sender of the message might later deny that
system.
The attacker can use several strategies to achieve this.
no insertion
no deletion
3. Authentication :
The authentication service is concerns with
party
Destination: proof that the message was received by the
specified party
Example
transaction, but later denied that. How the bank can protect
itself in a such situation?
5. Access control :
Provides protection against unauthorized
access to the data.
6. Availability service :
Protects a system to ensure its availability
Particularly, it addresses denial-of-service
attacks.
Designed to detect, prevent or recover from a security
attack
Security mechanisms are used to implement security
services.
Security Mechanisms:
Encipherment
Digital signature
Authentication Exchange
Traffic Padding
Routing Control
Notarisation
Cryptography : (Greek word)- Secret writing
The science and art of transforming messages to make them
secure and immune to attacks
Components involved in cryptography :
Key Key
Alice Bob
data, control
channel
messages
secure secure
secure data
data
sender receiver
receiver
Trudy
Cryptography
Means hidden writing, the practice of using encryption to conceal
text
Cryptanalysis
Study of encryption and encrypted message, with the goal of
finding the hidden meaning of the messages.
Symmetric key –
Same key is used for encryption and decryption.
Hence the key is called the shared secret key.
Drawbacks of symmetric key :
◦ Key must remain secret at both ends
◦ In large networks, there are many keys pairs to be
managed
◦ Sound cryptographic practices dictates that the key be
changed frequently
◦ The shared secret key must be transmitted through an
insecure transmission channel.
Call the plaintext stream P, the ciphertext stream C, and the key stream K.
Keystream may be a stream of predetermined values or
May be created by an algorithm or can be a single value.
Note : Monoalphabetic cipher
k={k,k,k…….}
Block Cipher:
Encrypts a group of plaintext symbols to produce a group of
ciphertext symbols of the same size.
A single key is used to encrypt the block even if the key is
made
up of multiple values.
1. Substitution Cipher
A substitution cipher replaces one symbol/character with another.
a) Monoalphabetic Cipher
b) Polyalphabetic Cipher
P= plaintext character
C= ciphertext character
k=key
Use the additive cipher with key = 15 to encrypt the message
“hello”.
with
his officers.
Hence called Caeser’s cipher.
substitute.
The relationship between a character in the plaintext to
so on.
Assume that Alice and Bob agreed to use an autokey
cipher with initial key value k1 = 12. Now Alice wants to
send Bob the message “Attack is today”. Enciphering is
done character by character.
2. Playfair cipher
Polyalphabetic cipher used by the British
plaintext
i.e keystream can be created without knowing the
plaintext
Encrypt the message “She is listening” using the
6-character keyword “PASCAL”. The initial key
stream is (15, 0, 18, 2, 0, 11). The key stream is
the repetition of this initial key stream (as many
times as needed).
V E R N A M C I P H E R
21 4 17 13 0 12 2 8 15 7 4 17
76 48 16 82 44 03 58 11 60 05 10 88
Step 2: Add the numeric equivalent and the corresponding random no.
Sum 97 52 33 95 44 15 60 19 75 12 14 105
Step 3 : Perform sum mod 26
19 0 7 17 18 15 8 19 23 12 14 1
Ciphertext ----
t a h r s p i t x m o b
Decryption
Step 1
a = (numeric equivalent of ciphertext - key)
Step 2
a mod 26
(if a negative then keep adding 26 till you get a positive no.)
Step 3
Convert numeric equivalent back to alphabet
Eg of decryption
t a h r s p i t x m o b
19 0 7 17 18 15 8 19 23 12 14 1
76 48 16 82 44 03 58 11 60 05 10 88
21 4 17 13 0 12 2 8 15 7 4 17
V E R N A M C I P H E R
Eg 2 plaintext H E L L O
7 4 11 11 14
key 23 12 2 10 11
(Msg+ key) 30 16 13 21 25
(Msg+ key) mod 26 4 16 13 21 25
E Q N V Z --- CIPHERTEXT
Decryption
4 16 13 21 25
key 23 12 2 10 11
(Ciphertext-key) -19 4 11 11 14
(Ciphertext-key) mod 26 7 4 11 11 14
H E L L O ----- Plaintext
5. Hill cipher
Invented by Lester S. Hill
blocks.
Hence Hill cipher is a block cipher.
The key matrix in the Hill cipher needs to have a multiplicative inverse.
Assume block size is 3
Hence key matrix is 3 x 3
Let K= 2 3 15
5 8 12
1 13 4
The key matrix should have a multiplicative inverse
How to find?
Find the determinant of the key i.e
2(8x4-13x12)-3(5x4-12x1)+15(5x13-8x1)=583
583 mod 26=11, gcd(11,26)=1
Hence matrix is invertible mod 26
Assume text to be encrypted is CRYPTOGRAPHY.
C R Y P T O G R A P H Y
2 17 24 |15 19 14| 6 17 0 | 15 7 24
P = 2 15 6 15
17 19 17 7
24 14 0 24
Encryption --
(K.P ) mod 26 =
2 3 15 2 15 6 15 25 11 11 21
5 8 12 17 19 17 7 = 18 5 10 3 =C
1 13 4 24 14 40 2 7 6 19 20
C= 25 18 7 11 5 6 11 10 19 21 3 20
Decryption
Decryption Key K-1
K= 2 3 15
5 8 12
1 13 4
Step 1 Find cofactor of matrix K
+-+
- + -
+-+
For finding new K11- 8x4 – 12x13 = -124
For finding new K12- -(5x4 – 12x1) = -8
For finding new K13- 13x5 – 8x1 = 57
For finding new K21- -(4x3– 15x13)= 183
Co factor matrix - -124 -8 57
183 -7 -23
-84 51 1
Step 2 Adjoint is obtained by taking the transpose of the
cofactor matrix
-124 183 -84
-8 -7 51
57 -23 1
Step 3 Find the det(k) mod 26 =11
Step 4 Find the multiplicative inverse of 11 in Z 26 = 19
Step 5 Multiply 19 by the adjoint matrix
-124 183 -84
19x -8 -7 51
57 -23 1
= -2356 3477 1596
-152 -133 969
1083 -437 19
Taking mod 26 we get the inverse K-1
K-1 = 10 19 16
4 23 7
17 5 19
To decrypt P=K-1xC
P=
10 19 16 25 11 11 21
4 23 7 18 5 10 3
17 5 19 7 6 19 20