0% found this document useful (0 votes)
12 views

Cryptography and Network Security

The document provides an overview of computer security concepts, focusing on the OSI model, cryptography, and various encryption techniques including symmetric and public-key cryptography. It discusses the importance of confidentiality, integrity, and availability in securing data, along with different types of attacks and security mechanisms. Additionally, it covers classical encryption methods, cryptanalysis, and the requirements for secure encryption practices.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Cryptography and Network Security

The document provides an overview of computer security concepts, focusing on the OSI model, cryptography, and various encryption techniques including symmetric and public-key cryptography. It discusses the importance of confidentiality, integrity, and availability in securing data, along with different types of attacks and security mechanisms. Additionally, it covers classical encryption methods, cryptanalysis, and the requirements for secure encryption practices.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 98

Ali Ashraf Molla

ETE 448
 Introduction to seven layers of OSI model,
Introduction to computer security, CIA TRIAD,
Threats and Attacks, examples of passive
active attacks. Classical Encryption
Techniques: Symmetric Encryption Model,
Cryptanalysis, Substitution Techniques,
Polyalphabetic Cipher, Transposition
Techniques. Block Ciphers: Feistel Cipher,
DES.
 PublicKey Cryptography: RSA and Diffie-
Hellman algorithms. Hash functions: SHA. Key
Distribution and User Authentication –
Needham-Schroeder Public-Key Protocol,
Kerberos. Transport-Level Security: SSL,
HTTPS and SSH. IP Security: IPsec Services, IP
security policy, Security Association. Digital
Signature: Requirement, structure and policy.
 Computer data often travels from one computer
to another, leaving the safety of its protected
physical surroundings. Once the data is out of
hand, people with bad intention could modify or
forge your data, either for amusement or for
their own benefit.
 Cryptography can reformat and transform our
data, making it safer on its trip between
computers. The technology is based on the
essentials of secret codes, augmented by modern
mathematics that protects our data in powerful
ways.
 Computer Security - generic name for the
collection of tools designed to protect data
from hackers
 Network Security - measures to protect data
during their transmission.
 Internet Security - measures to protect data
during their transmission over a collection of
interconnected networks.
 To assess the security needs of an
organization effectively, the manager
responsible for security needs some
systematic way of defining the requirements
for security and characterization of
approaches to satisfy those requirements.
One approach is to consider three aspects
of information security:
 Security attack – Any action that
compromises the security of information
owned by an organization.
 Security mechanism – A mechanism that is
designed to detect, prevent or recover from
a security attack.
 Security service – A service that enhances
the security of the data processing systems
and the information transfers of an
organization. The services are intended to
counter security attacks and they make use
of one or more security mechanisms to
provide the service.
 Computer Security:
 The protection afforded to an automated information
system in order to attain the applicable objectives of
preserving the following properties of information
system resources (includes hardware, software,
firmware, information/data, and telecommunications).
[NIST]
 Integrity,
 Availability,
 Confidentiality
 Confidentiality:
◦ Data confidentiality: confidential information
◦ Privacy: individuals control what information related to
them may be collected/stored and by who can access that
 Integrity:
◦ Data integrity: information and programs are changed only
in a specified and authorized manner.
◦ System integrity: a system performs its intended function in
an unimpaired manner, free from unauthorized
manipulation of the system.
 Availability: Assures that systems work promptly and service
is not denied to authorized users.
 Security requirements
 Authenticity
◦ The property of being genuine and being able to be
verified and trusted;
◦ confidence in the validity of a message originator.
◦ verifying that users are who they say they are
 Accountability
◦ The security goal that generates the requirement for
actions of an entity to be traced uniquely to that entity.
◦ This supports nonrepudiation, deterrence, fault
isolation, intrusion detection and prevention, and after-
action recovery and legal action.
 ITU-T X.800 “Security Architecture for OSI”
 Defines a systematic way of defining and providing
security requirements
 For us it provides a useful, if abstract, overview of
concepts we will study
 Consider 3 aspects of information security
 Security attack
◦ Any action that compromises the security of information owned
by an organization.
 Security mechanism
◦ A process that is designed to detect, prevent, or recover from a
security attack.
 Security service
◦ A service that enhances the security of the data processing
systems of an organization.
◦ Intended to counter security attacks, and make use of one or more
security mechanisms to provide the service.
 Often threat & attack used to mean same thing
 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 a vulnerability.
 Attack
An assault on system security that derives from an
intelligent threat; that is, an intelligent act that is a
deliberate attempt (especially in the sense of a method or
technique) to evade security services and violate the
security policy of a system.
 Have a wide range of attacks, we can focus of generic
types of attacks
 Passive Attack
◦ nature of eavesdropping on, or monitoring of,
transmissions.
◦ The goal of the opponent is to obtain information
that is being transmitted.
 Active Attack
◦ involve some modification of the data stream
◦ or the creation of a false stream
 X.800 defines
◦ a security service as a service that is provided by a protocol
layer of communicating open systems and that ensures
adequate security of the systems or of data transfers.
◦ ISO | International Organization for Standardization
 RFC (Request for comment) 2828 defines
◦ a processing or communication service that is provided by a
system to give a specific kind of protection to system
resources; security services implement security policies and
are implemented by security mechanisms.
◦ IETF | Internet Engineering Task Force
 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
 Feature designed to detect, prevent, or recover from a security
attack
 No single mechanism that will support all services required
 However one particular element underlies many of the security
mechanisms in use:
◦ cryptographic techniques
 Hence our focus on this topic
 Specific security mechanisms: incorporated into the
appropriate protocol layer in order to provide some of
the OSI security services
◦ Encipherment
◦ digital signatures
◦ access controls
◦ data integrity
◦ authentication exchange
◦ traffic padding
◦ routing control
◦ notarization
 Pervasive security mechanisms: Mechanisms that are
not specific to any particular OSI security service or
protocol layer.
◦ trusted functionality
◦ security labels
◦ event detection
◦ security audit trails
◦ security recovery
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
Using this model requires us to:
1. select appropriate gatekeeper functions to identify
users
2. implement security controls to ensure only authorised
users access designated information or resources
trusted computer systems may be useful to help
implement this model
 Conventional / private-key / single-key
 sender and recipient share a common key
 all classical encryption algorithms are
private-key (opposite to Public Key)
◦ What is the difference between private and public
key ?
 was only type prior to invention of public-key
in 1970‟s
 and by far most widely used
 Plaintext: original message
 Cipher text: coded message
 Cipher: algorithm for transforming plaintext to
cipher text
 Key: info used in cipher known only to
sender/receiver
 Encipher (encrypt): converting plaintext to
cipher text
 Decipher (decrypt): recovering plain text from
cipher text
 Cryptography: study of encryption
principles/methods
 two requirements for secure use of symmetric
encryption:
◦ a strong encryption algorithm
◦ a secret key known only to sender / receiver
 assume encryption algorithm is known
 implies a secure channel to distribute key
 Message in plaintext
 For encryption, a key of the form
 Encryption algorithm forms the cipher text

 We can write this as


 Receiver decrypts,
 characterize cryptographic system by:
◦ type of encryption operations used
 substitution / transposition / product
◦ number of keys used
 single-key or private / two-key or public
◦ way in which plaintext is processed
 block / stream
 Objective to recover key not just message
 Two general approaches:
 Cryptanalytic attack: rely on the nature of the
algorithm plus perhaps some knowledge of
the general characteristics of the plaintext or
even some sample plaintext–ciphertext pairs.
 Brute-force attack: The attacker tries every
possible key on a piece of ciphertext until an
intelligible translation into plaintext is
obtained
 What information does the cryptanalytic know?
 Cipher text only
◦ only know algorithm & cipher text
◦ If statistical (e.g., English language), know or can identify
plaintext
◦ Brute-force attack is the only possible attack
 Known plaintext
◦ know/suspect one or more plaintext-cipher text pairs
◦ Know encryption algorithm
 Chosen plaintext
◦ know algorithm & cipher text
◦ select plaintext and obtain ciphertext
◦ Might be know some pattern (e.g. In PS file, electronic
fund transfer starts with some texts)
 Chosen ciphertext
◦ know algorithm & ciphertext
◦ select ciphertext and obtain plaintext
 Chosen text
◦ know algorithm & ciphertext
◦ Know the information of both chosen plaintext and
ciphertext attacks
◦ select plaintext or ciphertext to en/decrypt
 Unconditionally secure
◦ no matter how much computer power or time is
available, the cipher cannot be broken since the
cipher text provides insufficient information to
uniquely determine the corresponding plaintext
 Computationally secure
◦ given limited computing resources (e.g. time
needed for calculations is greater than age of
universe), the cipher cannot be broken
◦ More practical in real life
 always possible to simply try every key
 most basic attack, proportional to key
size
 assume either know / recognise
plaintext
 Symmetric Cipher Model
 Cryptography
 Cryptanalysis and Brute-Force Attack
 Substitution Techniques
 Caesar Cipher
 Monoalphabetic Ciphers
 Playfair Cipher
 Hill Cipher
 Polyalphabetic Ciphers
 One-Time Pad
 Transposition Techniques
 Rotor Machines
 Steganography
 Key Terms, Review Questions, and Problems
 A symmetric encryption scheme has five
Elements
1. Plaintext
2. Encryption algorithm
3. Secret key
4. Ciphertext
5. Decryption algorithm
 A symmetric cipher is one that uses the same
key for encryption and decryption.
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
ciphertexts would be unable to decipher the ciphertext
or figure out the key. This requirement is usually stated
in a stronger form: The opponent should be unable to
decrypt ciphertext or discover the key even if he or she
is in possession of a number of ciphertexts together
with the plaintext that produced each ciphertext.
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
 Cryptographic systems are characterized
along three independent dimensions:
1. The type of operations used for
transforming plaintext to ciphertext.
2. The number of keys used.
3. The way in which the plaintext is processed.
 Cryptanalysis attack : Cryptanalytic attacks rely
on the nature of the algorithm plus perhaps
some knowledge of the general characteristics of
the plaintext or even some sample plaintext–
ciphertext pairs. This type of attack exploits the
characteristics of the algorithm to attempt to
deduce a specific plaintext or to deduce the key
being used.
 Brute-force attack: The attacker tries every
possible key on a piece of ciphertext until an
intelligible translation into plaintext is obtained.
On average, half of all possible keys must be
tried to achieve success.
 Is know as classical encryption techniques

A substitution technique is one in which


the letters of plaintext are replaced by other
letters or by numbers or symbols.1 If the
plaintext is viewed as a sequence of bits, then
substitution involves replacing plaintext bit
patterns with ciphertext bit patterns.
 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. For
example,
 Plain: meet me after the toga party
 Cipher: PHHW PH DIWHU WKH WRJD SDUWB
 Note that the alphabet is wrapped around, so
that the letter following Z is A. We can define
the transformation by listing all possibilities,
as follows:

 Plain: abcdefghijklmnopqrstuvwxyz
 Cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
 The best-known multiple-letter encryption
cipher is the Playfair, which treats diagrams in
the plaintext as single units and translates
these units into ciphertext diagrams.
 Substitution Techniques
1. Caesar Cipher
2. Monoalphabetic Ciphers
3. Playfair Cipher
4. Hill Cipher
 Polyalphabetic Cipher
1. Vigenère Cipher
 Transposition Techniques
 Rotor Machines
 Where letters of plaintext are replaced by
other letters or by numbers or symbols
 if plaintext is viewed as a sequence of bits,
then substitution involves replacing plaintext
bit patterns with ciphertext bit patterns
 Earliest known substitution cipher by Julius
Caesar
 first attested use in military affairs
 replaces each letter by 3rd letter on
 example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
 can define transformation as:
abcdefghijklmnopqrstuvwxyz
DEFGHIJKLMNOPQRSTUVWXYZABC
 mathematically give each letter a number
abcdefghij k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

 Then have Caesar cipher as:


 However, a shift may be any amount
 General Ceaser cipher with shift k (1 ~ 25)
c = E(p) = (p + k) mod (26)
p = D(c) = (c – k) mod (26)
 only have 26 possible ciphers
◦ A maps to either of {A, B, .. Z}
 could simply try each in turn
 a brute force search
 given ciphertext, just try all shifts of letters
 do need to recognize when have plaintext
 Three important characteristics of this
problem enabled us to use a bruteforce
cryptanalysis:
1. The encryption and decryption algorithms
are known.
2. There are only 25 keys to try.
3. The language of the plaintext is known
and easily recognizable.
 Sample of compressed text, counter
the 3rd characteristic
 rather than just shifting the alphabet
 could shuffle (jumble) the letters arbitrarily
 each plaintext letter maps to a different
random ciphertext letter
 hence key is 26 letters long

Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN

Plaintext: ifwewishtoreplaceletters
Cipher text: WIRFRWAJUHYFTSDVFSFUUFYA
 now have a total of 26! = 4 x 10^26 keys
 with so many keys, might think is secure
 but would be !!!WRONG!!!
 problem is language characteristics
 human languages are redundant
 eg "th lrd s m shphrd shll nt wnt"
 letters are not equally commonly used
 in English E is by far the most common
letter
◦ followed by T,R,N,I,O,A,S
 other letters like Z,J,K,Q,X are fairly rare
 have tables of single, double & triple letter
frequencies for various languages
 key concept – mono-alphabetic substitution
ciphers do not change relative letter frequencies
 discovered by Arabian scientists in 9th century
 calculate letter frequencies for cipher text
 compare counts/plots against known values
 if Ceaser cipher look for common peaks/troughs
◦ peaks at: A-E-I triple, NO pair, RST triple
◦ troughs at: JK, X-Z
 for mono-alphabetic must identify each letter
◦ tables of common double/triple letters help
 Given ciphertext:
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
 count relative letter frequencies

 Guess P & Z are e and t, guess ZW is „th‟ and hence ZWP is


„the‟
 proceeding with trial and error finally get:
it was disclosed yesterday that several
informal but
direct contacts have been made with political
representatives of the viet cong in moscow
 Not even with large number of keys in a
monoalphabetic cipher could provide security
 One approach to improving security was to
encrypt multiple letters
 The Playfair Cipher is an example
 Invented by Charles Wheatstone in 1854, but
named after his friend Baron Playfair
 Will encrypt by taking pairs of letters
 a 5X5 matrix of letters based on a keyword
 fill in letters of keyword (without duplicates)
 fill rest of matrix with other letters
 eg. using the keyword MONARCHY
 Repeating plaintext letters that are in the same pair are
separated with a filler letter, such as x, so that balloon would
be treated as ba lx lo on.
 Two plaintext letters that fall in the same row of the matrix
are each replaced by the letter to the right, with the first
element of the row circularly following the last. For example,
ar is encrypted as RM.
 Two plaintext letters that fall in the same column are each
replaced by the letter beneath, with the top element of the
column circularly following the last. For example, mu is
encrypted as CM.
 Otherwise, each plaintext letter in a pair is replaced by the
letter that lies in its own row and the column occupied by the
other plaintext letter. Thus, hs becomes BP and ea becomes
IM (or JM).
 security much improved over monoalphabetic
 since have 26 x 26 = 676 digrams
 would need a 676 entry frequency table to analyse
(verses 26 for a monoalphabetic)
 and correspondingly more ciphertext
 was widely used for many years
◦ eg. by US & British military in WW1
 it can be broken, given a few hundred letters
 since still has much of plaintext structure
 Matrix arithmetic modulo 26
 The inverse of a square matrix M by
the equation

 The inverse does not always exists


 First we have to calculate the determinant det A
 For a 2X2 matrix,
 Determinant is
 For a 3x3 matrix,
 If the determinant is non-zero only then the
inverse exists
 Inverse is computed as
 Where, is the sub-determinant formed by
deleting the j-th row and the i-th column of A
 det(A) is the determinant
note,

=
 This encryption algorithm takes „m‟
successive plaintext letters and
substitutes for them „m‟ cipher text
letters.
 The substitution is determined by
linear equations in which each
character is assigned a numerical value
.
 For m = 3, the system can be
described as

O
 In matrix format,
r
Here
 Strength
◦ completely hides single-letter frequencies.
◦ the use of a larger matrix hides more frequency
◦ information. For example, a 3x3 Hill cipher hides
not only single-letter but also two-letter frequency
information.
 Weaknesses
◦ easily broken with a known plaintext attack
◦ For an m x m Hill cipher, suppose we have „m‟
plaintext–ciphertext pairs, each of length „m‟, then
we can break the key.
 polyalphabetic substitution ciphers
 improves security using multiple cipher
alphabets
 make cryptanalysis harder with more
alphabets to guess and flatter frequency
distribution
 use a key to select which alphabet is used for
each letter of the message
 use each alphabet in turn
 repeat from start after end of key is reached
 simplest polyalphabetic substitution cipher
 effectively multiple Caesar ciphers
 key is multiple letters long K = k1 k2 ... kd
 ith letter specifies ith alphabet to use
 use each alphabet in turn
 repeat from start after d letters in message
 decryption simply works in reverse
 write the plaintext out
 write the keyword repeated above it
 use each key letter as a Caesar cipher
key
 encrypt the corresponding plaintext
letter
 eg using keyword deceptive
 have multiple ciphertext letters for each
plaintext letter
 hence letter frequencies are obscured
 but not totally lost
 start with letter frequencies
◦ see if look monoalphabetic or not
 if not, then need to determine number of
alphabets, since then can attach each
 method developed by Babbage / Kasiski
 repetitions in ciphertext give clues to period
 so find same plaintext an exact period apart
 which results in the same ciphertext
 of course, could also be random fluke
 eg repeated “VTW” in previous example
 suggests size of 3 or 9
 then attack each monoalphabetic cipher
individually using same techniques as before
 now consider classical transposition or
permutation ciphers
 these hide the message by rearranging the
letter order
 without altering the actual letters used
 can recognise these since have the same
frequency distribution as the original text
 write message letters out diagonally over a
number of rows
 then read off cipher row by row
 eg. write message out as:
m e m a t r h t g p r y
e t e f e t e o a a t
 giving ciphertext
MEMATRHTGPRYETEFETEOAAT
 a more complex transposition
 write letters of message out in rows over a
specified number of columns
 then reorder the columns according to some
key before reading off the rows
 an alternative to encryption
 hides existence of message
◦ using only a subset of letters/words in a longer
message marked in some way
◦ using invisible ink
◦ hiding in LSB in graphic image or sound file
 has drawbacks
◦ high overhead to hide relatively few info bits
 Shows an example in which a subset of
the words of the overall message is
used to convey the hidden message.
See if you can decipher this; it‟s not
too hard.

You might also like