CCS Unit 1
CCS Unit 1
Computer Security Concepts – The OSI Security Architecture – Security Attacks – Security Services and
Mechanisms – A Model for Network Security – Classical encryption techniques: Substitution techniques,
Transposition techniques, Steganography – Foundations of modern cryptography: Perfect security – Information
Theory – Product Cryptosystem – Cryptanalysis.
PART - A
1. What is the OSI security architecture?
The OSI (open system interconnection) security architecture provides a systematic framework for
defining security attacks, mechanisms and services.
2. Difference between passive and active attacks. (NOV/DEC 2020)
Page 1
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Page 2
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
10. List out the difference between a block cipher and a stream cipher.
S.NO BLOCK CIPHER STREAM CIPHER
Block cipher Converts the plain text into Stream cipher Converts the plain text into
1 cipher text by taking plain text’s block at cipher text by taking 1 byte of plain text at a
a time. time.
Block cipher uses either 64 bits or more
2 While stream cipher uses 8 bits.
than 64 bits.
The complexity of block cipher is
3 simple. While stream cipher is more complex.
Page 3
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
14. What is the difference between an unconditionally secure cipher and a computationally secure cipher?
S.No Unconditionally Secure Cipher Computationally Secure Cipher
An unconditionally secure cipher is a scheme A computationally secure scheme is such
such that if the cipher text generated by the that the cost of breaking the cipher exceeds
scheme does not contain enough information the value of the encrypted information and
1
to determine uniquely the corresponding plain the time required to break the cipher
text, no matter how much cipher text is exceeds the useful lifetime of the
available information.
The cipher cannot be broken no matter how The cipher cannot be broken given limited
2
much computer power or time is available computing resources
Ex: The only example is OTP (one time
3 Ex: DES,AES,RC4,etc.,
passwords)
Table 1.3 – Unconditionally secure cipher vs. computationally secure cipher
15. Briefly define the Playfair cipher. (MAY /JUNE 2011)
The Playfair cipher treats the diagrams in the plaintext as single units and translates these units
into cipher text diagrams.
This algorithm is based on the use of a 5 by 5 matrix of letters constructed using keyword.
Consider keyword as monarchy.
The matrix is constructed by filling in the letters of the keyword from left to right and from top
to bottom, and then filling in the remainder of the matrix with the remaining letters. The letters
I, J count as one letter
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
The rules to be followed are:
Repeating plaintext letters that come in the same pair are separated with a filer letter, such as x.
Plaintext letters that fall in the same row are replaced by the letter to the right, with the first
element of the row circularly following the first.
Plaintext letters that fall in the same column are replaced by the letter beneath, with the top
element circularly following the last.
Otherwise each letter is replaced by the letter that lies in its own row and the column occupied by
the other plaintext.
Page 4
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Page 5
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
The cost of breaking the cipher exceeds the value of the encrypted information
The time required to break the cipher exceeds the useful time of the information.
22. What are the key principles of security?
Key properties of security are,
To protect the data during transmission across the networks
Authentication
Confidentiality
Integrity
Access control
23. What types of information might be derived from a traffic analysis attack?
The following types of information can be derived from traffic analysis attack,
Identities of partners
How frequently the partners are communicating
Message pattern, message length, or quantity of messages that suggest important
information is being exchanged
The events that correlate with special conversations between particular partners.
24. What is Rail fence Transposition Technique?
In this technique plaintext is written down as a sequence of diagonals and then read off as a sequence
of rows.
25. Define Threats.
Information access threats or threats intercept or modify data on behalf of users who should not have
access to that data. Service threats exploit service flaws in computers to inhibit use by legitimate users.
26. What are the aspects of information security?
There are three aspects of the information security.
Security attack
Security mechanism
Security Service
27. List some common information integrity functions.
Identification
Authorization
Page 6
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Concurrence
Liability
Endorsement
Validation
Time of occurrence
28. What is meant by attack?
An attack 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.
29. What are the essential ingredients of a symmetric cipher?
A symmetric encryption scheme has five ingredients:
Plaintext: This is the original intelligible message or data that is fed into the algorithm as input.
Encryption algorithm: The encryption algorithm performs various substitutions and transformations
on the plaintext.
Secret Key: The secret key is also input to the encryption algorithm. The key is the value independent
of the plaintext. The algorithm will produce a different output depending on the specific key being
used at the time. The exact substitutions and transformations performed by the algorithm depend on
the key.
Cipher text: This is the scrambled message produced as output. It depends on the plaintext and the
key.
Decryption algorithm: This is essentially the encryption algorithm in reverse. It takes the cipher text
and the secret key and produces the original plaintext.
30. What are the two basic functions used in the encryption algorithm?
All the encryption algorithms are based on two general principles:
Substitution: In which each element in the plaintext (bit, letter, group of bits or letters) is mapped
into another element.
Transposition: In which elements in the plaintext are rearranged.
31. Briefly define the Caesar cipher. (NOV/DEC 2021)
The Caesar cipher involves replacing each letter of the alphabet with the letter standing three places
down the alphabet .The alphabet is wrapped around, so that the letter following Z is A.
C = E (p) = (p + 3) mod (26)
The general Caesar cipher algorithm is
C = E (p) = (p + k) mod (26)
EX: Let message = “Anna”, and k = 3, find the cipher text using Caesar
Cipher text: cppc
Where k takes the value in the range 1 to 25
Page 7
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Page 8
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
A group G, sometimes denoted by {G, .} is a set of elements with a binary operation, denoted
by . , that associates
41. What is the difference between a Caesar cipher and monoalphabetic cipher? (NOV/DEC 2020)
S.No Caesar Cipher Mono alphabetic Cipher
The Caesar cipher is the simplest and oldest
Monoalphabetic cipher is one where each
method of cryptography. The Caesar cipher
1 character of a plain text is mapped to a
method is based on a mono-alphabetic
fixed other character of cipher text.
cipher
The Caesar cipher is a kind of replacement The relationship between a character in the
2 (substitution) cipher, where all letter of plain plain text and the characters in the cipher
text is replaced by another letter. text is one-to-one.
Caesar ciphers is a weak method of It is a simple type of substitution cipher.
cryptography. It can be easily hacked. It Monoalphabetic ciphers are not that
3
means the message encrypted by this stronger as compared to polyalphabetic
method can be easily decrypted. cipher.
Table 1.5 – Caesar cipher vs Mono alphabetic cipher
42. Convert the given text “Anna University” into cipher text using rail fence technique.
Plain text: Anna University
Cipher text: anuiestnanvry
43. Why modular arithmetic has been used in cryptography? (AU NOV/DEC 2013)
Because it is used to find multiplicative inverse in cryptography. so modular arithmetic has been
used in cryptography
44. What are active and passive attacks that compromise information security? (NOV/DEC 2020)
1. Passive Attacks: These attacks are in the nature of eavesdropping on, or monitoring of, transmissions. The
goal of the opponent is to obtain information that is being transmitted.
Two types of passive attacks are,
Release of message contents where an eavesdropper tries to learn the contents of what is being
transmitted.
Traffic analysis, where the opponent tries to observe the pattern, frequency and length of messages being
exchanged which could be used in guessing the nature of the communication that is taking place.
Page 9
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
2. Active Attacks: Active attacks involve some modification of the data stream or the creation of a false stream.
These attacks present the opposite characteristics of passive attacks. It is difficult to prevent active attacks
absolutely because to do so would require physical protection of all communications facilities and paths at all
times.
45. Why random numbers are used in network security? (AU May/Jun 2014)
Nonce’s in authentication protocols to prevent replay
Session keys
Public key generation
Key stream for a one‐time pad
46. What are the two basic functions used in encryption algorithms? (AU Nov/Dec 2014)
The two basic functions used in encryption algorithms are
Substitution
Transposition
47. Let message = “Anna”, and k = 3, find the cipher text using Caesar. (Nov/Dec-2021)
Encryption
A n n A
+3 +3 +3 +3
D q q D
48. What is called block cipher and a stream cipher? (AU Nov/Dec 2014)
A block cipher processes the input one block of elements at a time, producing an output block for each
input block.
A stream cipher processes the input elements continuously, producing output one element at a time, as it
goes along.
49. Decipher the following cipher text using brute force attack. (AU NOV/DEC 2014)
CMTMROOEOORW using Rail fence
Solution:
CTROORMMOEOW
50. Describe in general terms an efficient procedure for picking a prime number.
The procedure for picking a prime number is as follows:
1. Pick an odd integer n at random (eg., using a pseudorandom number generator).
2. Pick an integer a<n at random.
3. Perform the probabilistic primality test, such as Miller-Rabin. If n fails the test, reject the
value n and go to step 1.
4. If n has passed a sufficient number of tests, accept n; otherwise, go to step 2.
51. Define Fermat Theorem.
Fermat Theorem states the following: If p is prime and a is a positive integer not divisible by p, then
Page 10
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Ap-1=a mod n
52. Determine the gcd(24140,16762) using Euclid’s algorithm.(NOV/DEC 2021)
Soln:
We know,
gcd(a,b)=gcd(b,amod b) gcd(24140,16762)=gcd(16762,7378) gcd(7378,2006)=gcd(2006,1360)
gcd(1360,646)=gcd(646,68) gcd(68,34)=34 gcd(24140,16762) = 34.
53. Define Fermat's Theorem.
ap-1 = 1 (mod p)
where p is prime and gcd(a,p)=1
Also known as Fermat’s Little Theorem
Also ap = p (mod p)
Useful in public key and primality testing
54. Define Euler Totient Function ø(n). (NOV/DEC 2021)
To compute ø(n) need to count number of residues to be excluded
In general need prime factorization, but
for p (p prime) ø(p) = p-1
for p.q (p,q prime) ø(pq) = (p-1)x(q-1)
Ex.
ø (37) = 36
ø (21) = (3–1)x(7–1) = 2x6 = 12
55. Define Euler's Theorem. (Nov/Dec 2009)
A generalisation of Fermat's Theorem
aø(n) = 1 (mod n)
For any a,n where gcd(a,n)=1
Ex.
a=3; n=10; ø(10)=4;
hence, 34 = 81 = 1 mod 10
a=2; n=11; ø(11)=10;
hence, 210 = 1024 = 1 mod 11
Page 11
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Page 12
AR ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Vigenere Cipher is a method of encrypting alphabetic text. It uses a simple form of polyalphabetic
substitution. A polyalphabetic cipher is any cipher based on substitution, using multiple
substitution alphabets. The encryption of the original text is done using the Vigenère square or
Vigenère table.
The table consists of the alphabets written out 26 times in different rows,each alphabet shifted
cyclically to the left compared to the previous alphabet, corresponding to the 26 possible Caesar
Ciphers.
At different points in the encryption process, the cipher uses a different alphabet from one of the
rows. The alphabet used at each point depends on a repeating keyword
Page 13
MAILAM ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
PART – B
1. Explain in detail about Computer Security Concepts.
Computer Security:
The protection afforded to an automated information system in order to attain the applicable
objectives of preserving the integrity, availability, and confidentiality of information system
resources (includes hardware, software, firmware, information/data, and
telecommunications).
This definition introduces three key objectives that are at the heart of computer security:
■ Confidentiality: This term covers two related concepts:
o Data confidentiality: Assures that private or confidential information is not made
available or disclosed to unauthorized individuals.
o Privacy: Assures that individuals control or influence what information related to them
may be collected and stored and by whom and to whom that information may be disclosed.
■ Integrity: This term covers two related concepts:
o Data integrity: Assures that information (both stored and in transmitted packets) and
programs are changed only in a specified and authorized manner.
o System integrity: Assures that a system performs its intended function in an unimpaired
manner, free from deliberate or inadvertent unauthorized manipulation of the system.
■ Availability: Assures that systems work promptly and service is not denied to authorized users.
These three concepts form what is often referred to as the CIA triad.
The three concepts embody the fundamental security objectives for both data and for
information and computing services.
For example, the NIST standard FIPS 199 (Standards for Security Categorization of Federal
Information and Information Systems) lists confidentiality, integrity, and availability as the
three security objectives for information and for information systems.
FIPS 199 provides a useful characterization of these three objectives in terms of requirements
and the definition of a loss of security in each category:
3. Because of point 2, the procedures used to provide particular services are often
counterintuitive. Typically, a security mechanism is complex, and it is not obvious from the
statement of a particular requirement that such elaborate measures are needed. It is only when the
various aspects of the threat are considered that elaborate security mechanisms make sense.
4. Having designed various security mechanisms, it is necessary to decide where to use them.
This is true both in terms of physical placement (e.g., at what points in a network are certain
security mechanisms needed) and in a logical sense (e.g., at what layer or layers of an
architecture such as TCP/IP [Transmission Control Protocol/Internet Protocol] should
mechanisms be placed).
5. Security mechanisms typically involve more than a particular algorithm or protocol. They also
require that participants be in possession of some secret information (e.g., an encryption key),
which raises questions about the creation, distribution, and protection of that secret information.
There also may be a reliance on communications protocols whose behavior may complicate the
task of developing the security mechanism.
For example, if the proper functioning of the security mechanism requires setting time limits
on the transit time of a message from sender to receiver, then any protocol or network that
introduces variable, unpredictable delays may render such time limits meaningless.
6. Computer and network security is essentially a battle of wits between a perpetrator who tries
to find holes and the designer or administrator who tries to close them. The great advantage that
the attacker has is that he or she need only find a single weakness, while the designer must find
and eliminate all weaknesses to achieve perfect security.
7. There is a natural tendency on the part of users and system managers to perceive little benefit
from security investment until a security failure occurs.
8. Security requires regular, even constant, monitoring, and this is difficult in today’s short-term,
overloaded environment.
9. Security is still too often an afterthought to be incorporated into a system after the design is
complete rather than being an integral part of the design process.
10. Many users and even security administrators view strong security as an impediment to
efficient and user-friendly operation of an information system or use of information.
CONTENTS
1. Introduction
2. Authentication
• Peer Entity Authentication
• Data Origin Authentication
3. Access Control
4. Data Confidentiality
• Connection Confidentiality
• Connectionless Confidentiality
• Selective-Field Confidentiality
• Traffic Flow Confidentiality
5. Data Integrity
Connection Integrity with Recovery
Connection Integrity without Recovery
Selective-Field Connection Integrity
Connectionless Integrity
Selective-Field Connectionless Integrity
6. Nonrepudiation
• Nonrepudiation, Origin
• Nonrepudiation, Destination
7. Availability Service
1. Introduction
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.
Perhaps a clearer definition is found in RFC 2828, which provides the following definition: 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.
X.800 divides these services into five categories and fourteen specific services.
2. Authentication
The authentication service is concerned with assuring that a communication is authentic. In the
case of a single message, such as a warning or alarm signal, the function of the authentication
service is to assure the recipient that the message is from the source that it claims to be from.
In the case of an ongoing interaction, such as the connection of a terminal to a host, two
aspects are involved.
First, at the time of connection initiation, the service assures that the two entities are
authentic, that is, that each is the entity that it claims to be.
Second, the service must assure that the connection is not interfered with in such a way that a
third party can masquerade as one of the two legitimate parties for the purposes of
unauthorized transmission or reception.
Two specific authentication services are defined in X.800:
o Peer Entity Authentication
Used in association with a logical connection to provide confidence in the identity of the
entities connected.
o Data Origin Authentication
In a connectionless transfer, provides assurance that the source of received data is as claimed.
3. Access Control
The prevention of unauthorized use of a resource (i.e., this service controls who can have
access to a resource, under what conditions access can occur, and what those accessing the
resource are allowed to do).
4. Data Confidentiality
Confidentiality is the protection of transmitted data from passive attacks. With respect to the
content of a data transmission, several levels of protection can be identified. The broadest
service protects all user data transmitted between two users over a period of time
The protection of data from unauthorized disclosure.
o Connection Confidentiality
The protection of all user data on a connection.
o Connectionless Confidentiality
The protection of all user data in a single data block
o Selective-Field Confidentiality
The confidentiality of selected fields within the user data on a connection or in a single
data block.
o Traffic Flow Confidentiality
The protection of the information that might be derived from observation of traffic
flows.
5. Data Integrity
As with confidentiality, integrity can apply to a stream of messages, a single message, or
selected fields within a message. Again, the most useful and straightforward approach is total
stream protection.
A connection-oriented integrity service, one that deals with a stream of messages, assures that
messages are received as sent with no duplication, insertion, modification, reordering, or
replays. The destruction of data is also covered under this service. Thus, the connection-oriented
integrity service addresses both message stream modification and denial of service.
On the other hand, a connectionless integrity service, one that deals with individual messages
without regard to any larger context, generally provides protection against message modification
only.
We can make a distinction between service with and without recovery. Because the integrity
service relates to active attacks, we are concerned with detection rather than prevention. If a
violation of integrity is detected, then the service may simply report this violation, and some
other portion of software or human intervention is required to recover from the violation.
Alternatively, there are mechanisms available to recover from the loss of integrity of data,
as we will review subsequently. The incorporation of automated recovery mechanisms is, in
general, the more attractive alternative.
Note -The assurance that data received are exactly as sent by an authorized entity (i.e.,contain no
modification, insertion, deletion, or replay).
protocol layer or security service. Figure 1: shows the Relationship between security and
mechanisms.
Encipherment
The use of mathematical algorithms to transform data into a form that is not readily
intelligible. The transformation and subsequent recovery of the data depend on an
algorithm and zero or more encryption keys.
Digital Signature
Data appended to, or a cryptographic transformation of, a data unit that allows a recipient
of the data unit to prove the source and integrity of the data unit and protect against
forgery (e.g., by the recipient).
Access Control
A variety of mechanisms that enforce access rights to resources.
Data Integrity
A variety of mechanisms used to assure the integrity of a data unit or stream of data units.
Authentication Exchange
A mechanism intended to ensure the identity of an entity by means of information
exchange.
Traffic Padding
The insertion of bits into gaps in a data stream to frustrate traffic analysis attempts.
Routing Control
Enables selection of particular physically secure routes for certain data and allows routing
changes, especially when a breach of security is suspected.
Notarization
The use of a trusted third party to assure certain properties of a data exchange.
Pervasive Security Mechanisms
Mechanisms those are not specific to any particular OSI security service or protocol layer.
Trusted Functionality
That which is perceived to be correct with respect to some criteria
e.g., as established by a security policy.
Security Label
The marking bound to a resource (which may be a data unit) that names or designates the
PREPARED BY: Ms.G.SARASWATHI AP/CSE, Mrs.S.M.SASSIREKHA AP/CSE, Mrs.S.ASWINI AP/CSE Page 22
MAILAM ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
o Traffic analysis.
Active Attacks
o Masquerade,
o Replay,
o Modification of messages, and
o Denial of service.
Introduction
Security attacks, uses both in X.800 and RFC 2828, are in terms of passive attacks and
active attacks. A passive attack attempts to learn or make use of information from the
system but does not affect system resources.
An active attack attempts to alter system resources or affect their operation. Passive
attacks are in the nature of eavesdropping on, or monitoring of, transmissions.
The goal of the opponent is to obtain information that is being transmitted. Two types of
passive attacks are the release of message contents and traffic analysis.
The release of message contents is easily understood.
Passive Attacks
Passive attacks (Refer Figure 1.2) are in the nature of eavesdropping on, or monitoring
of, transmissions. The goal of the opponent is to obtain information that is being
transmitted.
Two types of passive attacks are:
The release of message contents and
Traffic analysis.
The release of message contents is easily understood. A telephone conversation, an
electronic mail message, and a transferred file may contain sensitive or confidential
information.
A second type of passive attack, traffic analysis, is subtler. Suppose that we had a way
of masking the contents of messages or other information traffic so that opponents, even
if they captured the message, could not extract the information from the message.
Active Attacks
Active attacks (Refer Figure 1.3) involve some modification of the data stream or the
creation of a false stream and can be subdivided into four categories:
masquerade,
replay,
modification of messages, and
Denial of service.
A masquerade - A masquerade attack usually includes one of the other forms of active
attack.
Replay involves the passive capture of a data unit and its subsequent retransmission to
produce an unauthorized effect.
Modification of messages simply means that some portion of a legitimate message is
altered, or that messages are delayed or reordered, to produce an unauthorized effect.
The denial of service prevents or inhibits the normal use or management of communications
facilities.
Contents
Introduction
Security attack
Security mechanism
Security service
Introduction
ITU-T3 Recommendation X.800, Security Architecture for OSI, defines such a systematic
approach.4 The OSI security architecture is useful to managers as a way of organizing the task of
providing security.
These can be defined briefly as
Security attack: Any action that compromises the security of information owned by an
organization.
Security service: A processing or communication 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.
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.
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.
PREPARED BY: Ms.G.SARASWATHI AP/CSE, Mrs.S.M.SASSIREKHA AP/CSE, Mrs.S.ASWINI AP/CSE Page 26
MAILAM ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Security Attacks
A useful means of classifying security attacks, used both in X.800 and RFC 2828, is in terms
passive attacks and active attacks.
A passive attack attempts to learn or make use of information from the system but does not
affect system resources.
An active attack attempts to alter system resources or affect their operation.
Passive Attacks
Passive attacks are in the nature of eavesdropping on, or monitoring of, transmissions. The
goal of the opponent is to obtain information that is being transmitted.
Two types of passive attacks are release of message contents and traffic analysis.
(Refer Figure 1.4.a and 1.4 b)
The release of message contents is easily understood .A telephone conversation, an electronic
mail message, and a transferred file may contain sensitive or confidential information.
.
Fig 1.4 (a) Releases of message contents and (b).Traffic analysis
A message is to be transferred from one party to another across some sort of Internet service. The
two parties, who are the principals in this transaction, must cooperate for the exchange to take
place.
A logical information channel is established by 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.
Security aspects come into play when it is necessary or desirable to protect the information
transmission from an opponent who may present a threat to confidentiality, authenticity, and so on.
All the techniques for providing security have two components:
All the techniques for providing security have two components:
A security-related transformation on the information to be sent.
Some secret information shared by the two principals and, it is hoped, unknown to the
opponent. A trusted third party may be needed to achieve secure transmission.
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.
The security mechanisms needed to cope with unwanted access fall into two broad categories
(Refer Figure 1.6).
The first category might be termed a gatekeeper function. It includes password-
based login procedures and screening logic that is designed to detect and reject
worms, viruses.
The second line of defense consists of a variety of internal controls that monitor
activity and analyze stored information in an attempt to detect the presence of
unwanted intruders.
7. What are the essential ingredients classical encryption techniques of a symmetric cipher?
Contents
Ingredients
Requirements
Cryptography
Cryptanalysis and Brute-Force Attack
Cryptanalysis:
Brute-force attack:
Ingredients
• 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.
8. What is the different substitution techniques involved in classic encryption technique in
Substitution Techniques? (OR) Briefly define the Caesar cipher. Briefly define the
monoalphabetic cipher. Briefly define the Playfair cipher, Hill Cipher, Polyalphabetic Ciphers
and one time pad. (NOV/DEC 2021) (NOV/DEC 2020)
Contents
Introduction
Caesar Cipher
Monoalphabetic Ciphers
Playfair Cipher
Hill Cipher
Polyalphabetic Ciphers
One-Time Pad
Introduction
The two basic building blocks of all encryption techniques are substitution and
transposition.
A substitution technique is one in which the letters of plaintext are replaced by other
letters or by numbers or symbols. If the plaintext is viewed as a sequence of bits, then
substitution involves replacing plaintext bit patterns with ciphertext bit patterns.
Caesar Cipher (Apr/May-2019)
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,
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:
Then the algorithm can be expressed as follows. For each plaintext letter p, substitute the
ciphertext letter C:
Where, k takes on a value in the range 1 to 25. The decryption algorithm is simply
If it is known that a given cipher text is a Caesar cipher, then a brute-force cryptanalysis
is easily performed: simply try all the 25 possible keys.
Figure 1.9. Shows the results of Brute-Force applying this strategy is the example of
cipher text. In this case, the plaintext leaps out as occupying the third line.
Three important characteristics of this problem enabled us to use a brute force
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.
In this case, the keyword is monarchy. The matrix is constructed by filling in the letters
of the keyword (minus duplicates) from left to right and from top to bottom, and then
filling in the remainder of the matrix with the remaining letters in alphabetic order. The
letters I and J count as one letter.
Hill Cipher
Demonstrate encryption and decryption process in hill cipher. Consider m = “sh”
and key = hill”. (NOV/DEC-2021)
The Hill Algorithm This encryption algorithm takes m successive plaintext letters and
substitutes for them m cipher text letters. The substitution is determined by m linear
equations in which each character is assigned a numerical value (a = 0, b = 1, c, z = 25).
For m = 3, the system can be described as
For example1, consider the plaintext “paymoremoney” and use the encryption Key The
first three letters of the plaintext are represented by the vector (15 0 24). Then(15 0 24)K
= (303 303 531) mod 26 = (17 17 11) = RRL. Continuing in this fashion, the cipher text
for the entire plaintext is RRLMWBKASPDH.
For example2, consider the plaintext “sh” and use the encryption Key .The first three
letters of the plaintext are represented by the vector (8 9 12). Then(8 9)K = (305 305 531)
mod 26 = (16 16 2) = PPB. Continuing in this fashion, the cipher text for the entire
plaintext is PPB.
Polyalphabetic Ciphers
PREPARED BY: Ms.G.SARASWATHI AP/CSE, Mrs.S.M.SASSIREKHA AP/CSE, Mrs.S.ASWINI AP/CSE Page 36
MAILAM ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Similarly, decryption is
To encrypt a message, a key is needed that is as long as the message. Usually, the key is a
repeating keyword. For example, if the keyword is deceptive, the message “we are
discovered save yourself” is encrypted as
In addition, the key is to be 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.
Such a scheme, known as a one-time pad, 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 Example
This sort of thing would be trivial to cryptanalyze. A more complex scheme is to write the
message in a rectangle, row by row, and read the message off, column by column, but permute
the order of the columns. The order of the columns then becomes the key to the algorithm. For
example,
Thus, in this example, the key is 4312567. To encrypt, start with the column that is
labeled 1, in this case column 3. Write down all the letters in that column. Proceed to
column 4, which is labeled 2, then column 2, then column 1, then columns 5, 6, and 7.
The transposition cipher can be made significantly more secure by performing more than
one stage of transposition. The result is a more complex permutation that is not easily
reconstructed. Thus, if the foregoing message is reencrypted using the same algorithm,
To visualize the result of this double transposition, designate the letters in the original
plaintext message by the numbers designating their position. Thus, with 28 letters in the
message, the original sequence of letters is
This is a much less structured permutation and is much more difficult to crypt analyze.
Contents
Techniques
Character marking
Invisible ink
Pin punctures
Typewriter correction ribbon
Techniques
The methods of steganography conceal the existence of the message, whereas the methods of
cryptography 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. Consider an example A Puzzle for Inspector Morse 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.(Refer figure 1.11 Conversion of plain text into cipher text)
11. Encrypt the message “this is an exercise” using additive cipher with key = 20. Ignore the
space between words. Decrypt the message to get the Original plaintext.
(NOV/DEC 2021)
Encryption :
In the shift cipher, the encryption algorithm is “shift key characters down”, with equal to some
number. Shifting characters down is to move the characters to the end of the alphabet. If we
reach the end of the alphabet, we wrap around.
Given key = 20 and the message to be encrypted is “THIS IS AN EXERCISE”
We encode the characters A to Z as 1 to 26. To wrap around, we subtract 26
We first encode each letter in order encode the entire message.
T – 20 + 20 = 40 – 26 = 14 N
H – 8 + 20 = 28 − 26 = 2 B
I – 9 + 20 = 29 − 26 = 3 C
S – 19 + 20 = 39 − 26 = 13 M
I – 9 + 20 = 29 − 26 = 03 C
S – 19 + 20 = 39 − 26 = 13 M
A – 0 + 20 = 20 U
N –14 + 20 = 34 − 26 = 08 H
E – 5 + 20 = 25 Y
X – 24 + 20 = 44 − 26 = 18 R
E – 5 + 20 = 25 Y
R – 18 + 20 = 38 − 26 = 12 L
C – 3 + 20 = 23 W
I – 9 + 20 = 29 − 26 = 03 C
S – 19 + 20 = 39 − 26 = 13 M
E – 5 + 20 = 25 Y
Therefore the encoded message is NBCM CM UH YRYLWCMY
Fig.1.12 shows the types of Cryptology, the study of cryptosystems, can be subdivided into two
branches −
Cryptography
Cryptanalysis
Cryptosystems
A cryptosystem is an implementation of cryptographic techniques and their
accompanying infrastructure to provide information security services. A cryptosystem is
also referred to as a cipher system.
The illustration Fig. 1.13 shows a sender who wants to transfer some sensitive data to a
receiver in such a way that any party intercepting or eavesdropping on the communication
channel cannot extract the data.
The objective of this simple cryptosystem is that at the end of the process, only the sender
and the receiver will know the plaintext.
Components of a Cryptosystem
The various components of a basic cryptosystem are as follows −
d by the encryption algorithm using a specific the encryption key. Plaintext. It is the data to
be protected during transmission.
Encryption Algorithm. It is a mathematical process that produces a cipher text for any
given plaintext and encryption key. It is a cryptographic algorithm that takes plaintext and
an encryption key as input and produces a cipher text.
Cipher text. It is the scrambled version of the plaintext produce The cipher text is not
guarded. It flows on public channel. It can be intercepted or compromised by anyone who
has access to the communication channel.
Encryption Key. It is a value that is known to the sender. The sender inputs the encryption
key into the encryption algorithm along with the plaintext in order to compute the cipher
text.
Decryption Key. It is a value that is known to the receiver. The decryption key is related to
the encryption key, but is not always identical to it. The receiver inputs the decryption key
into the decryption algorithm along with the cipher text in order to compute the plaintext.
For a given cryptosystem, a collection of all possible decryption keys is called a key space.
An interceptor (an attacker) is an unauthorized entity who attempts to determine the plaintext. He
can see the cipher text and may know the decryption algorithm. He, however, must never know
the decryption key.
Types of Cryptosystems
Fundamentally, there are two types of cryptosystems based on the manner in which
encryption- decryption is carried out in the system −
Symmetric Key Encryption
The main difference between these cryptosystems is the relationship between the encryption and
the decryption key.
Logically, in any cryptosystem, both the keys are closely associated. It is practically impossible to
decrypt the cipher text with the key that is unrelated to the encryption key.
Prior to 1970, all cryptosystems employed symmetric key encryption. Even today, its
relevance is very high and it is being used extensively in many cryptosystems. It is very
unlikely that this encryption will fade away, as it has certain advantages over asymmetric
key encryption.
The salient features of cryptosystem based on symmetric key encryption are −
Persons using symmetric key encryption must share a common key prior to
exchange of information.
Keys are recommended to be changed regularly to prevent any attack on the system.
A robust mechanism needs to exist to exchange the key between the communicating
parties. As keys are required to be changed regularly, this mechanism becomes expensive
and cumbersome. In a group of n people, to enable two-party communication between any
two persons, the number of keys required for group is n × (n – 1)/2.
Length of Key (number of bits) in this encryption is smaller and hence, process of
Key establishment − before any communication, both the sender and the receiver need to agree
on a secret symmetric key. It requires a secure key establishment mechanism in place.
Trust Issue − Since the sender and the receiver use the same symmetric key, there is an implicit
requirement that the sender and the receiver ‘trust’ each other. For example, it may happen that
the receiver has lost the key to an attacker and the sender is not informed.
These two challenges are highly restraining for modern day communication. Today, people need to
exchange information with non-familiar and non-trusted parties. For example, a communication
between online seller and customer. These limitations of symmetric key encryption gave rise to
asymmetric key encryption schemes.
Asymmetric Key Encryption
The encryption process where different keys are used for encrypting and decrypting the
information is known as Asymmetric Key Encryption. Though the keys are different, they are
mathematically related and hence, retrieving the plaintext by decrypting cipher text is feasible.
The process is depicted in the following Fig 1.15
Asymmetric Key Encryption was invented in the 20th century to come over the necessity
of pre- shared secret key between communicating persons. The salient features of this
encryption scheme are as follows –
Every user in this system needs to have a pair of dissimilar keys, private key and
public key. These keys are mathematically related when one key is used for
encryption, the other can decrypt the cipher text back to the original plaintext.
It requires to put the public key in public repository and the private key as a well-
guarded secret. Hence, this scheme of encryption is also called Public Key
Encryption.
Though public and private keys of the user are related, it is computationally not
feasible to find one from another. This is a strength of this scheme.
When Host1 needs to send data to Host2, he obtains the public key of Host2 from
repository, encrypts the data, and transmits.
Host2 uses his private key to extract the plaintext.
Length of Keys (number of bits) in this encryption is large and hence, the process
of encryption-decryption is slower than symmetric key encryption.
Processing power of computer system required to run asymmetric algorithm is higher.
Symmetric cryptosystems are a natural concept. In contrast, public-key
cryptosystems are quite difficult to comprehend.
• You may think, how can the encryption key and the decryption key are ‘related’,
and yet it is impossible to determine the decryption key from the encryption key?
The answer lies in the mathematical concepts.
• It is possible to design a cryptosystem whose keys have this property. The concept
of public-key cryptography is relatively new. There are fewer public-key
algorithms known than symmetric algorithms.
Public-key cryptosystems have one significant challenge − the user needs to trust that
the public key that he is using in communications with a person really is the public key
of that person and has not been spoofed by a malicious third party.
The third party satisfies itself about user identity by the process of attestation,
notarization, or some other process − that X is the one and only, or globally unique, X.
The most common method of making the verified public keys available is to embed
them in a certificate which is digitally signed by the trusted third party.
A summary of basic key properties of two types of cryptosystems is given below – (Refer
Table 1.7)
Due to the advantages and disadvantage of both the systems, symmetric key and public-key
cryptosystems are often used together in the practical information security systems
13. List out any two di-gram, two tri-gram. Shortly describe the application of di-gram and tri-
gram in cryptography. (NOV/DEC 2021)
PREPARED BY: Ms.G.SARASWATHI AP/CSE, Mrs.S.M.SASSIREKHA AP/CSE, Mrs.S.ASWINI AP/CSE Page 49
MAILAM ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
Monogram
Bigram
Trigram
Frequency counts
Introduction to Frequency Analysis
14. Using Fermat’s theorem, find a mod p and prove Euler’s totient value of any prime number
p is p-1 and the Euler’s totient value of any non prime number n is (p-1)*(q-9). (NOV/DEC
2021)
Contents
Fermat’s Theorem
Proof:
Euler’s Totient Function
Euler’s Theorem
Proof:
Two theorems that play important roles in public-key cryptography are Fermat’s theorem
and Euler’s theorem.
Fermat’s Theorem
Fermat’s theorem states the following: If p is prime and a is a positive integer not
divisible by p, then
Proof:
Consider the set of positive integers less than p: {1, 2, c, p - 1} and multiply each element
by a, modulo p, to get the set X = {a mod p, 2a mod p, c, (p - 1)a mod p}.
Multiplying the numbers in both sets (p and X) and taking the result mod p yields
We can cancel the (p - 1)! term because it is relatively prime to p . This yields Equation
which completes the proof.
Note that the first form of the theorem [Equation (8.2)] requires that a be relatively prime
to p, but this form does not.
Now suppose that we have two prime numbers p and q with p≠ q. Then we can show that,
for n = pq,
Euler’s Theorem
Euler’s theorem states that for every a and n that are relatively prime:
Proof:
f(n) = (n - 1) and Fermat’s theorem holds. However, it also holds for any integer n.
Recall that f(n) is the number of positive integers less than n that are relatively prime to n.
Consider the set of such integers, labeled as
That is, each element xi of R is a unique positive integer less than n with gcd(xi, n) = 1.
Now multiply each element by a, modulo n:
This completes the proof. This is the same line of reasoning applied to the proof of
Fermat’s theorem.
As is the case for Fermat’s theorem, an alternative form of the theorem is also useful:
PART-A
1. Write about Fermat and Euler’s theorem in detail. (MAY/JUNE 2013) (AU APRIL /
MAY2011) (AU Nov/Dec 2012)
2. Explain Substitution Techniques in cryptography. (NOV/DEC 2012) (June2013)
3. Write about any two classical cryptosystem (substitution and transposition) with example.
(MAY/JUNE 2013)(MAY/JUN 2014)
4. What are the different types of attacks? Explain. (NOV/DEC 2013)
5. State and explain Chinese remainder theorem with example. (NOV/DEC 2013)
6. State Fermat’s theorem. (NOV/DEC 2013)
7. Find 321 mod 11 using Fermat’s theorem. (NOV/DEC 2013)
8. State Euler’s theorem to find gcd with example. (NOV/DEC 2013)
9. Explain Monoalphabetic Ciphers & playfair cipher, Hill cipher.
10. Explain classical encryption techniques. (April/ May 2017)
11. Explain in detail about Finite fields. (MAY/JUN 2014)
12. Encrypt the message “PAY” using Hill cipher with the following key matrix and show the
decryption to get the original plaintext. (NOV/DEC 2014)
K= 17 17 5
21 18 21
2 2 19
13. Describe : a) playfair cipher b) Railfence cipher C) Vigenere cipher.(AU MAY 2017)
14. State Chinese Reminder theorem and find X for the given set of congruent equations using
CRT. X=1(mod 5) X=2(mod 7) X=3(mod 9) X=4(mod 11). (MAY 2017)
NOV/DEC-2021
PART-A
1. What is meant by Denial of Service attack? Is it Active Attack or Passive Attack?
2. Let message = “Anna”, and k = 3, find the cipher text using Caesar.
PART-B
11. (a) (i) Let message = “graduate”, Key = “word”, find ciphertext using playfair cipher. (8)
(ii) List out any two di-gram, two tri-gram. Shortly describe the application of di-gram and tri-
gram in cryptography. (5)
Or
PREPARED BY: Ms.G.SARASWATHI AP/CSE, Mrs.S.M.SASSIREKHA AP/CSE, Mrs.S.ASWINI AP/CSE Page 55
MAILAM ENGINEERING COLLEGE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CB3491 CRYPTOGRAPHY AND CYBER SECURITY - UNIT 1
(b) Demonstrate encryption and decryption process in hill cipher. Consider m = “sh” and key =
hill”. (13)
NOV/DEC-2020
PART-A
1. Compare active and passive attack.
2. Encrypt the plaintext to be or not to be using the vigenere cipher for the key value Now.
PART-B
11. a) i) What is monoalphabetic cipher ? Examine how it differs from Caesar cipher. (7)
ii) Encrypt the message “this is an exercise” using additive cipher with key = 20. Ignore the
space between words. Decrypt the message to get the original plaintext. (6)
(or)
11. b) i) Explain OSI Security Architecture model with neat diagram. (7)
ii) Describe the various security mechanisms. (6)