0% found this document useful (0 votes)
9 views126 pages

CSS Module 1.1

The document provides an introduction to network security, focusing on security goals such as confidentiality, integrity, and non-repudiation. It distinguishes between passive and active attacks, outlining various forms of each, and discusses security services and mechanisms, including cryptography and steganography. Additionally, it covers key concepts in cryptography, including symmetric and asymmetric key algorithms, cryptanalysis, and specific cipher types.

Uploaded by

Piyush Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views126 pages

CSS Module 1.1

The document provides an introduction to network security, focusing on security goals such as confidentiality, integrity, and non-repudiation. It distinguishes between passive and active attacks, outlining various forms of each, and discusses security services and mechanisms, including cryptography and steganography. Additionally, it covers key concepts in cryptography, including symmetric and asymmetric key algorithms, cryptanalysis, and specific cipher types.

Uploaded by

Piyush Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 126

MODULE 1

INTRODUCTION AND NUMBER THEORY


SECURITY GOALS

CONFIDENTIALITY
INTEGRITY

SECURE

NON-REPUDIATION
Security Aspects
consider 3 aspects of Network security:

● security attack
● security mechanism (control)
● security service
ATTACKS
Passive Versus Active Attacks
Passive Attacks
● In a passive attack, the attacker’s goal is just to obtain information. This
means that the attack does not modify data or harm the system. The system
continues with its normal operation.
● The attack may harm the sender or the receiver of the message. Attacks that
threaten confidentiality are passive attacks.
● The revealing of the information may harm the sender or receiver of the
message, but the system is not affected.
● For this reason, it is difficult to detect this type of attack until the sender or
receiver finds out about the leaking of confidential information.
● Passive attacks, however, can be prevented by encipherment of the data.
Active Attacks
● An active attack may change the data or harm the system.
● Attacks that threaten the integrity and availability are active attacks.
● Active attacks are normally easier to detect than to prevent, because an
attacker can launch them in a variety of ways.
Alice, Bob, and Eve
● Alice is the person who needs to send secure data.
● Bob is the recipient of the data.
● Eve is the person who somehow disturbs the communication
between Alice and Bob.
Passive Attack - Interception
Passive Attack: Traffic Analysis

Observe traffic
pattern
Active Attack: Interruption

Block delivery of
message
Active Attack: Fabrication

Fabricate message
Active Attack: Replay
Active Attack: Modification

Modify
message
Handling Attacks
◦ Passive attacks – focus on Prevention
● Easy to stop
● Hard to detect
◦ Active attacks – focus on Detection and Recovery
● Hard to stop
● Easy to detect
Security Services
? Authentication - assurance that the communicating entity is the
one claimed

? Access Control - prevention of the unauthorized use of a resource

? Data Confidentiality –protection of data from unauthorized


disclosure

? Data Integrity - assurance that data received is as sent by an


authorized entity

? Non-Repudiation - protection against denial by one of the parties


in a communication
Security Mechanisms
Specific security mechanisms: Pervasive security mechanisms:
• Encipherment • Trusted functionality
• Digital signatures • Security labels
• Event detection
• Access controls
• Security audit trails
• Data integrity
• Security recovery
• Authentication exchange
• Traffic padding
• Routing control
Security Mechanisms
? Distinguishes between two mechanisms
1. reversible encipherment mechanism
2. Irreversible encipherment mechanisms

20
Model for Network Security
Model for Network Security
? using this model requires us to:
1. design a suitable algorithm for the security transformation
2. generate the secret information (keys) used by the algorithm
3. develop methods to distribute and share the secret information
4. specify a protocol enabling the principals to use the
transformation and secret information for a security service
Model for Network Access
Security
Model for Network Access
Security
? using this model requires us to:

1. select appropriate gatekeeper functions to identify users

1. implement security controls to ensure only authorised


users access designated information or resources
SERVICES AND MECHANISMS
Security Mechanisms
Relation between security services and security mechanisms
TECHNIQUES

The actual implementation of security goals needs some techniques.


Two techniques are prevalent today:
● very general (cryptography)
● specific (steganography).
Cryptography

● Symmetric-Key Encipherment
● Asymmetric-Key Encipherment
● Hashing
Steganography

● Technique that was used for secret communication in the past is


being revived at the present time: steganography.
● The word steganography, with origin in Greek, means “covered
writing,” in contrast with cryptography, which means “secret
writing.”
● Cryptography means concealing the contents of a message by
enciphering; steganography means concealing the message itself
by covering it with something else.
● Today, any form of data, such as text, image, audio, or video, can be digitized,
and it is possible to insert secret binary information into the data during
digitization process.
● Such hidden information is not necessarily used for secrecy; it can also be
used to protect copyright, prevent tampering, or add extra information.
Traditional Symmetric-Key Ciphers
Kerckhoff’s Principle
● Although it may appear that a cipher would be more secure if we hide both
the encryption/decryption algorithm and the secret key, this is not
recommended. Based on Kerckhoff’s principle, one should always assume
that the adversary, Eve, knows the encryption/decryption algorithm.
● The resistance of the cipher to attack must be based only on the secrecy of
the key.
● In other words, guessing the key should be so difficult that there is no need to
hide the encryption/decryption algorithm.
● This principle manifests itself more clearly when we study modern ciphers.
● There are only a few algorithms for modern ciphers today. The key domain for
each algorithm, however, is so large that it makes it difficult for the adversary
to find the key.
cryptography
Definition
cryptography
? A word with Greek origins, means “secret writing”.
? The term to refer to the science and art of transforming
messages to make them secure and immune to attacks.
? Applications of cryptography includes ATM cards, computer
passwords, and electronic commerce.
History
Cryptography Issues
Cryptography Issues
? Confidentiality: Only sender, intended receiver should
“understand” message contents.
? End-Point Authentication: Sender and receiver want to confirm
identity of each other.
? Message Integrity: Sender and receiver want to ensure message not
altered (in transit, or afterwards) without detection.
? Message Nonrepudiation: Message nonrepudiation means that a
sender must not be able to deny sending a message that he or she, in
fact, did send.
? Entity Authentication: In entity authentication (or user
identification) the entity or user is verified prior to access to the
system resources
Cryptography
components
Plaintext and Ciphertext
? The original message, before being transformed, is called
plaintext.
? After the message is transformed, it is called ciphertext.
? An encryption algorithm transforms the plaintext into
ciphertext; a decryption algorithm transforms the ciphertext
back into plaintext.
? Example:
◦ Plaintext: HELLO
◦ Ciphertext: KHOOR
Cipher
? Encryption and Decryption algorithms are referred as
ciphers.
? Also used to refer to different categories of algorithms
in cryptography.
? Example (Traditional Substitution Ciphers):
◦ Monoalphabetic cipher
◦ Polyalphabetic cipher
● Plaintext: HELLO
● Ciphertext: ABNZF
key
? A key is a number (or a set of numbers) that the cipher
operates on, as an algorithm.
? To encrypt a message, we need an encryption algorithm,
an encryption key, and the plaintext.
? To decrypt a message, we need a decryption algorithm,
a decryption key, and the ciphertext. These reveal the
original plaintext.
? Types:
◦ Shared key, Public key and Private key.
Use of Key
? Example:
? Use Monoalphabetic Cipher to encrypt “HELLO” with key =
3.
◦ Plaintext: HELLO
◦ Ciphertext: KHOOR
Cryptography Categories
Cryptography Categories
? We can divide all the cryptography algorithms (ciphers) into
two groups:
◦ Symmetric key (also called secret-key) cryptography
algorithms and
◦ Asymmetric key (also called public-key) cryptography
algorithms.
Symmetric key cryptography

? In symmetric-key cryptography, the same key is used by


both parties.
? The sender uses this key and an encryption algorithm to
encrypt data; the receiver uses the same key and the
corresponding decryption algorithm to decrypt the data.
Symmetric key Ciphers
Traditional Modern
Ciphers Ciphers

Substitution Transposition
Simple Round
Ciphers Ciphers
Ciphers Ciphers
XOR,
DES, AES,
Mono-alp Poly-alphab Rotation,
IDEA,
habetic etic S-box,
CAST,
Ciphers Ciphers P-box
RC4,
etc.
RC5, etc.
asymmetric key cryptography
? In asymmetric or public-key cryptography, there are two
keys: a private key and a public key.
◦ The private key is kept by the receiver.
◦ The public key is announced to the public.
? If Alice wants to send a message to Bob, Alice uses the
public key to encrypt the message. When the message is
received by Bob, the private key is used to decrypt the
message.
? Some of the asymmetric algorithms are:
◦ Diffie-Hellman, RSA, El Gamal, Elliptic Curve
Comparison of
Symmetric and
Asymmetric key
cryptography
Symmetric key Asymmetric key
cryptography cryptography
? Only 1 shared key is ? Here 2 keys : a private and a
involved. public key are involved.
? The Public key encrypts the
? The same key encrypts and plaintext while the private
decrypts the plaintext. key decrypts it.
? The shared key is kept secret ? The private key is just kept
between Alice and Bob. secret by the Bob while the
? Examples of Symmetric public key is made public.
? Examples of Asymmetric
algorithms: algorithms:
◦ DES, 3DES, AES, IDEA, ◦ Diffie-Hellman, RSA, El
BLOWFISH, TWOFISH, Gamal, Elliptic Curve
RC4, RC5, SAFER etc. Cryptography (ECC) etc.
Cryptanalysis
A process of finding weaknesses in cryptographic algorithms
and using these weaknesses to decipher the ciphertext without
knowing the secret key
objective to recover key not just message
general approaches:
◦ cryptanalytic attack
◦ brute-force attack
Cryptanalysis
Cryptanalytic Attacks
? ciphertext only
◦ only know algorithm & ciphertext, is statistical,
know or can identify plaintext
? known plaintext
◦ know/suspect plaintext & ciphertext
? chosen plaintext
◦ select plaintext and obtain ciphertext
? chosen ciphertext
◦ select ciphertext and obtain plaintext
? chosen text
◦ select plaintext or ciphertext to en/decrypt
Traditional
Symmetric-Key Ciphers
● Fig shows the general idea behind a symmetric-key cipher.
● The original message from Alice to Bob is called plaintext;
the message that is sent through the channel is called the
ciphertext.
● To create the ciphertext from the plaintext, Alice uses an
encryption algorithm and a shared secret key.
● To create the plaintext from ciphertext, Bob uses a
decryption algorithm and the same secret key.
3.68
General idea of symmetric-key cipher

3.69
If P is the plaintext, C is the ciphertext, and K is the key,

We assume that Bob creates P1; we prove that P1 = P:


Locking and unlocking with the same key
Kerckhoff’s Principle
Based on Kerckhoff’s principle, one should always assume
that the adversary, Eve, knows the encryption/decryption
algorithm. The resistance of the cipher to attack must be
based only on the secrecy of the key.

3.72
Cryptanalysis

As cryptography is the science and art of creating secret codes, cryptanalysis


is the science and art of breaking those codes.

Cryptanalysis attacks
Ciphertext-Only Attack
Known-Plaintext Attack
Chosen-Plaintext Attack
Chosen-Ciphertext Attack
3-2 SUBSTITUTION CIPHERS
A substitution cipher replaces one symbol with another. Substitution
ciphers can be categorized as either monoalphabetic ciphers or
polyalphabetic ciphers.

Note

A substitution cipher replaces one symbol with


another.

3.2.1 Monoalphabetic Ciphres


3.2.2 Polyalphabetic Ciphers
Monoalphabetic Ciphers

Note

In monoalphabetic substitution, the relationship


between a symbol in the plaintext to a symbol in
the ciphertext is always one-to-one.
The following shows a plaintext and its corresponding
ciphertext. The cipher is probably monoalphabetic
because both l’s (els) are encrypted as O’s.

The following shows a plaintext and its corresponding


ciphertext. The cipher is not monoalphabetic because
each l (el) is encrypted by a different character.
Plaintext: hello Ciphertext: ABNZF
Additive Cipher
The simplest monoalphabetic cipher is the additive
cipher. This cipher is sometimes called a shift cipher and
sometimes a Caesar cipher, but the term additive cipher
better reveals its mathematical nature.
Plaintext and ciphertext in Z26
Additive cipher

Note

When the cipher is additive, the plaintext,


ciphertext, and key are integers in Z26.
Use the additive cipher with key = 15 to encrypt the
message “hello”.
Solution
We apply the encryption algorithm to the plaintext,
character by character:
Use the additive cipher with key = 15 to decrypt the
message “WTAAD”.
Solution
We apply the decryption algorithm to the plaintext
character by character:
Shift Cipher and Caesar Cipher
Historically, additive ciphers are called shift ciphers. Julius
Caesar used an additive cipher to communicate with his
officers. For this reason, additive ciphers are sometimes
referred to as the Caesar cipher. Caesar used a key of 3
for his communications.
Note

Additive ciphers are sometimes referred to


as shift ciphers or Caesar cipher.
Eve has intercepted the ciphertext “UVACLYFZLJBYL”. Show
how she can use a brute-force attack to break the cipher.

Eve tries keys from 1 to 7. With a key of 7, the plaintext is


“not very secure”, which makes sense.
Table 3.1 Frequency of characters in English

Table 3.2 Frequency of diagrams and trigrams


Eve has intercepted the following ciphertext. Using a
statistical attack, find the plaintext.

Solution
When Eve tabulates the frequency of letters in this
ciphertext, she gets: I =14, V =13, S =12, and so on. The
most common character is I with 14 occurrences. This
means key = 4.
Multiplicative Ciphers

Note

In a multiplicative cipher, the plaintext and ciphertext


are integers in Z26; the key is an integer in Z26*.
3.89
What is the key domain for any multiplicative cipher?
Solution
The key needs to be in Z26*. This set has only 12
members: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25.
We use a multiplicative cipher to encrypt the message
“hello” with a key of 7. The ciphertext is “XCZZU”.
Affine Ciphers
Affine cipher

3.91
The affine cipher uses a pair of keys in which the first key
is from Z26* and the second is from Z26. The size of the
key domain is
26 × 12 = 312.
Use an affine cipher to encrypt the message “hello” with
the key pair (7, 2).
Use the affine cipher to decrypt the message “ZEBBW” with
the key pair (7, 2) in modulus 26.

Solution

3.93
Monoalphabetic Substitution Cipher
Because additive, multiplicative, and affine ciphers have
small key domains, they are very vulnerable to brute-force
A better solution is to create a mapping between each
attack.
plaintext character and the corresponding ciphertext
character. Alice and Bob can agree on a table showing the
mapping for each character.
An example key for monoalphabetic substitution cipher
We can use the key (table in previous slide) to encrypt the
message

The ciphertext is
Polyalphabetic
Ciphers
In polyalphabetic substitution, each occurrence of a character may have a
different substitute. The relationship between a character in the plaintext to a
character in the ciphertext is one-to-many.

Autokey Cipher
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.
Playfair Cipher

An example of a secret key in the Playfair cipher

Let us encrypt the plaintext “hello” using the key in Figure


3.13.
Vigenere Cipher

We can encrypt the message “She is listening” using the


6-character keyword “PASCAL”.
Let us see how we can 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).
Vigenere cipher can be seen as combinations of m
additive ciphers.
A Vigenere cipher as a combination of m additive ciphers
Using Example 3.18, we can say that the additive cipher is
a special case of Vigenere cipher in which m = 1.

A Vigenere Tableau
Vigenere Cipher (Crypanalysis)
Let us assume we have intercepted the following
ciphertext:

The Kasiski test for repetition of three-character segments


yields the results shown in Table 3.4.
Let us assume we have intercepted the following
ciphertext:

The Kasiski test for repetition of three-character segments


yields the results shown in Table 3.4.
The greatest common divisor of differences is 4, which
means that the key length is multiple of 4. First try m = 4.

In this case, the plaintext makes sense.


Hill Cipher

Key in the Hill cipher

The key matrix in the Hill cipher needs to


have a multiplicative inverse.
For example, the plaintext “code is ready” can make a 3 ×
4 matrix when adding extra bogus character “z” to the
last block and removing the spaces. The ciphertext is
“OHKNIHGKLISS”.
Assume that Eve knows that m = 3. She has intercepted
three plaintext/ciphertext pair blocks (not necessarily
from the same message) as shown in Figure 3.17.
She makes matrices P and C from these pairs. Because P is
invertible, she inverts the P matrix and multiplies it by C
to get the K matrix as shown in Figure 3.18.

Now she has the key and can break any ciphertext
encrypted with that key.
One-Time Pad
One of the goals of cryptography is perfect secrecy. A study by
Shannon has shown that perfect secrecy can be achieved if each
plaintext symbol is encrypted with a key randomly chosen from a key
domain. This idea is used in a cipher called one-time pad, invented by
Vernam.

3.112
Rotor Cipher
3-3 TRANSPOSITION CIPHERS
A transposition cipher does not substitute one symbol for another, instead
it changes the location of the symbols.

A transposition cipher reorders symbols.

● Keyless Transposition Ciphers


● Keyed Transposition Ciphers
● Combining Two Approaches
Keyless Transposition Ciphers

Simple transposition ciphers, which were used in the past, are keyless.

A good example of a keyless cipher using the first


method is the rail fence cipher. The ciphertext is created
reading the pattern row by row. For example, to send the
message “Meet me at the park” to Bob, Alice writes

She then creates the ciphertext “MEMATEAKETETHPR”.


Alice and Bob can agree on the number of columns and
use the second method. Alice writes the same plaintext,
row by row, in a table of four columns.

She then creates the ciphertext “MMTAEEHREAEKTTP”.


The cipher in Example 3.23 is actually a transposition
cipher. The following shows the permutation of each
character in the plaintext into the ciphertext based on the
positions.

The second character in the plaintext has moved to the


fifth position in the ciphertext; the third character has
moved to the ninth position; and so on. Although the
characters are permuted, there is a pattern in the
permutation: (01, 05, 09, 13), (02, 06, 10, 13), (03, 07,
11, 15), and (08, 12). In each section, the difference
between the two adjacent numbers is 4.
Keyed Transposition Ciphers

The keyless ciphers permute the characters by using writing plaintext


in one way and reading it in another way The permutation is done on
the whole plaintext to create the whole ciphertext. Another method is
to divide the plaintext into groups of predetermined size, called blocks,
and then use a key to permute the characters in each block separately.

3.118
Alice needs to send the message “Enemy attacks tonight”
to Bob..

The key used for encryption and decryption is a


permutation key, which shows how the character are
permuted.

The permutation yields


Combining Two Approaches

Figure
3.21
Keys
In Example 3.27, a single key was used in two directions
for the column exchange: downward for encryption,
upward for decryption. It is customary to create two keys.

Encryption/decryption keys in transposition ciphers


Key inversion in a transposition cipher
Using Matrices
We can use matrices to show the encryption/decryption
process for a transposition cipher.

Representation of the key as a matrix in the transposition cipher


Figure 3.24 shows the encryption process. Multiplying the
4 × 5 plaintext matrix by the 5 × 5 encryption key gives
the 4 × 5 ciphertext matrix.

Representation of the key as a matrix in the transposition cipher

3.124
Double Transposition Ciphers
Double transposition cipher

You might also like