CB3491-Cryptography-and-Cyber-Security Notes
CB3491-Cryptography-and-Cyber-Security Notes
com
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.
SECURITY ATTACK
Passive attack
Passive attacks attempt to learn or make use of information from the system
but do not affect system resources. The goal of the opponent is to obtain
information that is being transmitted.
Release of message contents: The opponent would learn the contents of the
transmission. A telephone conversation, an e-mail message and a transferred
file may contain sensitive or confidential information. We would like to
prevent the opponent from learning the contents of these transmissions.
Traffic analysis: The opponent could determine the location and identity of
communicating hosts and could observe the frequency and length of
messages being exchanged. This information might be useful in guessing the
nature of the communication that was taking place. Passive attacks are very
difficult to detect, because they do not involve any alteration of the data.
However, it is feasible to prevent the success of these attacks.
Active attacks
These attacks involve some modification of the data stream or the creation of a
false stream.
Replay – The attacker captures the message and retransmits the message without
modification to produce unauthorized effect.
Modification of messages – The attacker captures the message and retransmits the
message with modification to produce unauthorized effect.
Denial of service – The attacker may suppress all messages directed to a particular
destination. Another form of service denial is the disruption of an entire network,
either by disabling the network or by overloading it with messages so as to degrade
performance.
It is quite difficult to prevent active attacks absolutely, because to do so
would require physical protection of all communication facilities and paths at all
times. Instead, the goal is to detect them and to recover from any disruption or
delays caused by them.
SECURITY SERVICES
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.
The classification of security services are as follows:
(ii) Access control: Access control is the ability to limit and control the access to
host systems and applications.
Connection Confidentiality
The protection of all user data on a connection
Connectionless Confidentiality
The protection of all user data in a single data block
Selective-Field Confidentiality
The confidentiality of selected fields within the user data on a connection or
in a single data block
Traffic-Flow Confidentiality
The protection of the information that might be derived from observation of
traffic flows
(iv)Data Integrity: The assurance that data received are exactly as sent by an
authorized entity.
SECURITY MECHANISMS
Encipherment:
It uses mathematical algorithm to transform data into a form that is not
readily intelligible. It depends upon encryption algorithm and key
Digital signature:
Data appended to or a cryptographic transformation of a data unit that is to
prove integrity of data unit and prevents from forgery
Access control
Data integrity
A variety of mechanism are used to ensure integrity of data unit
Traffic padding
The insertion of bits into gaps in a data stream to frustrate traffic analysis
attempts.
Notarization
The use of a trusted third party to assure certain properties of a data
exchange
defining a route through the internet from source to destination and by the
cooperative use of communication protocols (e.g., TCP/IP) by the two principals.
This general model shows that there are four basic tasks in designing a particular
security service:
1. Design an algorithm for performing the security-related transformation. The
algorithm should be such that an opponent cannot defeat its purpose.
2. Generate the secret information to be used with the algorithm.
3. Develop methods for the distribution and sharing of the secret information.
4. Specify a protocol to be used by the two principals that makes use of the security
algorithm and the secret information to achieve a particular security service.
SUBSTITUTION TECHNIQUES
Note that the alphabet is wrapped around, so that letter following ‘z’ is ‘a’.
For each plaintext letter p, substitute the cipher text letter c such that
c = E(3, p) = (p+3) mod 26
Decryption is
p=D(3,c)=(c-3) mod 26
As a first step, the relative frequency of the letters can be determined and
compared to a standard frequency distribution for English
Continued analysis of frequencies plus trial and error should easily yield a solution.
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,
as the encipherer wishes).
Example
Plain text: Balloon
Ba ll oo n
Ba lx lo on
BaI/JB
lxSU
loPM
onNA
C=KP mod 26
C and P are column vectors of length 3 representing the cipher and plain text
respectively.
Consider the message 'ACT', and
Decryption
(v)POLYALPHABETIC CIPHERS
Each of the 26 ciphers is laid out horizontally, with the key letter for each
cipher to its left. A normal alphabet for the plaintext runs across the top. The
process of encryption is simple: Given a key letter x and a plaintext letter y, the
cipher text is at the intersection of the row labelled x and the column labelled y; in
this case, the cipher text is V. To encrypt a message, a key is needed that is as long
as the message. Usually, the key is a repeating keyword.
Key=deceptive
Plain text= we are discovered save yourself
e.g., key = d e c e p t i v e d e c e p t i v e d e c e p t i v e
PT = w e a r e d i s c o v e r e d s a v e y o u r s e l f
CT = ZICVTWQNGRZGVTWAVZHCQYGLMGJ
Decryption is equally simple. The key letter again identifies the row. The position
of the cipher text letter in that row determines the column, and the plaintext letter
is at the top of that column.
Thus the cipher text is generated by performing the bitwise XOR of the
plaintext and the key. Decryption uses the same key. Because of the properties of
XOR, decryption simply involves the same bitwise operation:
Pi = Ci Ki
Advantages
It is unbreakable since cipher text bears no statistical relationship to the
plaintext
Not easy to break
Drawbacks
Practically impossible to generate a random key as to the length of the
message
The second problem is that of key distribution and key protection.
Due to the above two drawbacks, one time pad is of limited use and is used for low
band width channel which needs high security.
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.
m e a t e c o l o s
e t t h s h o h u e
CT = ESOTCUEEHMHLAHSTOETO
Demerits
Easily recognized because the frequency is same in both plain text and
cipher text.
Can be made secure by performing more number of transpositions.
STEGANOGRAPHY
STEGANOGRAPHY
A plaintext message may be hidden in one of two ways. The methods of steganography
conceal the existence of the message, whereas the methods of cryp-tography render the message
unintelligible to outsiders by various transformations of the text.
A simple form of steganography, but one that is time-consuming to construct, is one in
which an arrangement of words or letters within an apparently innocuous text spells out the real
message. For example, the sequence of first letters of each word of the overall message spells
out the hidden message. Figure 2.9 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.
Reference :William Stallings, Cryptography and Network Security: Principles and Practice, PHI 3rd Edition, 2006
Various other techniques have been used historically; some examples are the following:
• Character marking: Selected letters of printed or typewritten text are over-written in pencil.
The marks are ordinarily not visible unless the paper is held at an angle to bright light.
• Invisible ink: A number of substances can be used for writing but leave novisible trace until
heat or some chemical is applied to the paper.
• Pin punctures: Small pin punctures on selected letters are ordinarily not visible unless the
paper is held up in front of a light.
• Typewriter correction ribbon: Used between lines typed with a black ribbon, theresults of
typing with the correction tape are visible only under a strong light.
Although these techniques may seem archaic, they have contemporary equivalents.
Hiding a message by using the least significant bits of frames on a CD. For example, the Kodak
Photo CD format’s maximum resolution is 2048 _ 3072 pixels, with each pixel containing 24
bits of RGB color information.
The least significant bit of each 24-bit pixel can be changed without greatly affecting the
quality of the image. The result is that you can hide a 2.3-megabyte message in a single digital
snapshot. There are now a number of software packages available that take this type of
approach to steganography.
Steganography has a number of drawbacks when compared to encryption. It requires a lot
of overhead to hide a relatively few bits of information, although using a scheme like that
proposed in the preceding paragraph may make it more effective.Also, once the system is
discovered, it becomes virtually worthless. This problem, too, can be overcome if the insertion
method depends on some sort of key. Alternatively, a message can be first encrypted and then
hidden using steganography.
The advantage of steganography is that it can be employed by parties who have
something to lose should the fact of their secret communication (not necessarily the content) be
discovered. Encryption flags traffic as important or secret or may identify the sender or receiver
as someone with something to hide.
There are three major characteristics that separate modern cryptography from the classical
approach.
It requires the entire cryptosystem for Modern cryptography requires parties interested in
communicating confidentially. secure communication to possess the secret key
only.
Perfect Security
▪ A cipher system is said to offer perfect secrecy if, on seeing the ciphertext the interceptor
gets no extra informationabout the plaintext than he had before the ciphertext was
observed.
▪ In a cipher system with perfect secrecy the interceptor is “forced” to guess the plaintext.
▪ An encryption scheme satisfies perfect secrecy if for all messages m1, m2 in message
space M and all ciphertexts c ∈ C, we have
where both probabilities are taken over the choice of K in K and over the coin tosses of the
(possibly) probabilistic algorithm Enc.
▪ This can be formulated as: For all m(0) , m(1) ∈ M and c ∈ C we have:
▪ The probability here is over the randomness used in the Gen and Enc algorithms and the
probability distribution over the message space.
▪ Here we are assuming that c ∈ C has Pr[C = c] > 0. Everywhere this assumption will be
implicit
▪ We want to say that the probability of generating a ciphertext given as message m(0) , is
same as the probability of generating that ciphertext given any other different message
m(1)
▪ Shannon defines perfect secrecy for secret-key systems and shows that they exist.
▪ A secret-key cipher obtains perfect secrecy if for all plaintexts x and all ciphertexts y it
holds that Pr(x) = Pr(x|y).
Information theory
▪ For example, identifying the outcome of a fair coin flip (with two equally likely
outcomes) provides less information (lower entropy) than specifying the outcome from a
roll of a die (with six equally likely outcomes).
▪ Some other important measures in information theory are mutual information, channel
capacity, error exponents, and relative entropy.
Quantities of information
▪ Information theory often concerns itself with measures of information of the distributions
associated with random variables.
▪ Based on the probability mass function of each source symbol to be communicated, the
Shannon entropy H, in units of bits (per symbol), is given by
▪ where pi is the probability of occurrence of the i-th possible value of the source symbol.
▪ This equation gives the entropy in the units of "bits" (per symbol) because it uses a
logarithm of base 2, and this base-2 measure of entropy has sometimes been called
the shannon in his honor.
▪ If one transmits 1000 bits (0s and 1s), and the value of each of these bits is known to the
receiver (has a specific value with certainty) ahead of transmission, it is clear that no
information is transmitted.
▪ If 𝕏 is the set of all messages {x1, ..., xn} that X could be, and p(x) is the probability of
some x € X , then the entropy, H, of X is defined:[
▪ The special case of information entropy for a random variable with two outcomes is the
binary entropy function, usually taken to the logarithmic base 2, thus having the shannon
(Sh) as unit:
Joint entropy
▪ The joint entropy of two discrete random variables X and Y is merely the entropy of their
pairing: (X, Y). This implies that if X and Y are independent, then their joint entropy is the
sum of their individual entropies.
▪ For example, if (X, Y) represents the position of a chess piece — X the row and Y the
column, then the joint entropy of the row of the piece and the column of the piece will be
the entropy of the position of the piece.
▪ Despite similar notation, joint entropy should not be confused with cross entropy.
▪ Mutual information measures the amount of information that can be obtained about one
random variable by observing another. It is important in communication where it can be
used to maximize the amount of information shared between sent and received signals.
The mutual information of X relative to Y is given by:
▪ That is, knowing Y, we can save an average of I(X; Y) bits in encoding X compared to not
knowing Y.
▪ If we compress data in a manner that assumes q(X) is the distribution underlying some
data, when, in reality, p(X) is the correct distribution, the Kullback–Leibler divergence is
the number of average additional bits per datum necessary for compression.
▪ It is thus defined
Coding theory
▪ Coding theory is one of the most important and direct applications of information theory.
▪ It can be subdivided into source coding theory and channel coding theory.
▪ Using a statistical description for data, information theory quantifies the number of bits
needed to describe the data, which is the information entropy of the source.
▪ Data compression (source coding): There are two formulations for the compression
problem:
▪ lossy data compression: allocates bits needed to reconstruct the data, within a
specified fidelity level measured by a distortion function. This subset of
information theory is called rate–distortion theory.
Product Cryptosystems
▪ A cryptosystem S=(P,K, C,e,d) with the sets ofplaintexts P, keys K and cryptotextsC
andencryption (decryption) algorithms e (d) is called endomorphic if P=C.
▪ S1ÄS2=(P,K1ÄK2, P,e,d),
Cryptanalysis
▪ Cryptanalysis is the study of analyzing information systems in order to study the hidden
aspects of the systems.
▪ Cryptanalysis is used to breach cryptographic security systems and gain access to the
contents of encrypted messages, even if the cryptographic key is unknown.
Methods
▪ Adaptive chosen-plaintext: like a chosen-plaintext attack, except the attacker can choose
subsequent plaintexts based on information learned from previous encryptions.
Similarly Adaptive chosen ciphertext attack.
▪ Related-key attack: Like a chosen-plaintext attack, except the attacker can obtain
ciphertexts encrypted under two different keys. The keys are unknown, but the
relationship between them is known; for example, two keys that differ in the one bit.