Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

UNIT I INTRODUCTION & NUMBER THEORY

Services, Mechanisms and attacks-the OSI security architecture-Network security


model-Classical Encryption techniques (Symmetric cipher model, substitution
techniques, transposition techniques, steganography). FINITE FIELDS AND NUMBER
THEORY: Groups, Rings, Fields-Modular arithmetic- Euclid’s algorithm-Finite fields-
Polynomial Arithmetic –Prime numbers-Fermat’s and Euler’s theorem- Testing for
primality -The Chinese remainder theorem- Discrete logarithms.
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. What is the difference between passive and active attacks. Compare active
attacks and passive attacks.(Nov/Dec 2016)
 A passive attack attempt to learn or eavesdropping on transmission and it
does not affect system resources or affect their operations.
 A active attacks involve some modification of the data stream or information.
3. List the categories of passive attacks.
 Traffic analysis
 Release of message
4. List the categories of active attacks.
 Masquerade, Replay, Modification of massage, Denial of service
5. List the categories of security services.
 Authentication, Access control, Data confidentiality, Data integrity, Non
repudiation
6. List the categories of security mechanisms.
 Specific security mechanism
 Pervasive security mechanism
7. What are the essential ingredients of a symmetric cipher?
A symmetric cipher encryption has five ingredients. They are:
• Plaintext
• Encryption algorithm
• Secret key
• Cipher text
• Decryption algorithm
8. What are the two basic functions used in encryption algorithms?
The two basic functions used in encryption algorithms are
• Substitution
• Transposition
Prepared By: Mrs.A.Sarkunavathi AP/IT 1
9. How many keys are required for two people to communicate via a cipher?
 If both sender and receiver use the same key, the system is referred to as
symmetric, Single key, secret key, or conventional encryption.
 If the sender and receiver each use a different key, the system is referred to as
asymmetric, two-key, or public-key encryption.
10. What is the difference between a block cipher and a stream cipher?
 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.
11. What are the two approaches to attacking a cipher?
The two approaches to attack a cipher are:
• Cryptanalysis
• Brute-force attack
12. What is the difference between an unconditionally secure cipher and a
computationally secure cipher?
 An unconditionally secure cipher is a scheme such that if the cipher text
generated by the scheme does not contain enough information to determine
uniquely the corresponding plain text, no matter how much cipher text is
available.
 A computationally secure scheme is such that the cost of breaking the cipher
exceeds the value of the encrypted information and the time required to
break the cipher exceeds the useful lifetime of the information.
13. Briefly define the Caesar cipher. (NOV/DEC 2012) (NOV/DEC 2013)
 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
14. 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 ciphertext digrams.
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

Prepared By: Mrs.A.Sarkunavathi AP/IT 2


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.
16. What are the two problems with one-time pad?
• It makes the problem of making large quantities of random keys.
• It also makes the problem of key distribution and protection.
17. What is a transposition cipher? (NOV/DEC 2013)
 Transposition cipher is a cipher, which is achieved by performing some sort
of permutation on the plaintext letters.
Example: Plain text: meet me after the toga party
18. What is Steganography? (MAY/JUNE 2013)
 In stenography the plain text is hidden. The existence of the message is
concealed. For example the sequence of first letters of each word of the
overall message in the hidden message.
19. Explain the avalanche effect. (NOV/DEC 2012)
 It is that a small change in either the plaintext or the key should produce a
significant change in the cipher text. A change in one of the bit of the
plaintext or one bit of the key should produce a change in many bits of the
cipher text.
20. What is the difference between a mono alphabetic cipher and a poly
alphabetic cipher? (AU NOV/DEC 2012)
 Mono alphabetic cipher: Here a single cipher alphabet is used.

Prepared By: Mrs.A.Sarkunavathi AP/IT 3


 Poly alphabetic cipher: Here a set of related mono alphabetic substitution
rules is used.
21. List the types of cryptanalytic attacks.
• Cipher text only
• Known plaintext
• Chosen plaintext
• Chosen cipher text
• Chosen text
22. When an encryption algorithm is said to be computationally secured?
The encryption algorithm is said to be computationally secure if
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.
23. What are the key principles of security?
Key properties of security:
• To protect the data during transmission across the networks
• Authentication
• Confidentiality
• Integrity
• Access control
24. What types of information might be derived from a traffic analysis attack?
The following types of information can be derived from traffic analysis attack:
1. Identities of partners
2. How frequently the partners are communicating
3. Message pattern, message length, or quantity of messages that suggest
important information is being exchanged
4. The events that correlate with special conversations between particular
partners.
25. 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.
26. Define Threats.
 Information access 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.
27. What are the aspects of information security?

Prepared By: Mrs.A.Sarkunavathi AP/IT 4


There are three aspects of the information security.
Security attack
Security mechanism
Security Service
28. List some common information integrity functions?
 Identification
 Authorization
 Concurrence
 Liability
 Endorsement
 Validation
 Time of occurrence
29. 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.
30. 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.
31. 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.

Prepared By: Mrs.A.Sarkunavathi AP/IT 5


 Transposition: In which elements in the plaintext are rearranged.
32. Briefly define the Caesar cipher? (AU NOV/DEC 2012)
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)
Where k takes the value in the range 1 to 25
The decryption algorithm is
p = D(C) = (C - k) mod (26)
33. Briefly define the monoalphabetic cipher? (AU NOV/DEC 2012)
 A monoalphabetic cipher maps from a plain alphabet to cipher alphabet.
Here a single cipher alphabet is used per message
 A dramatic increase in the key space is achieved by allowing an arbitrary
substitution. There are 26! Possible keys. It is referred to as
monoalphabetic substitution cipher, because a single cipher alphabet is
used per message.
34. What is the difference between a monoalphabetic cipher and a polyalphabetic
cipher? (AU NOV/DEC 2012)
 In monoalphabetic cipher single cipher alphabet is used per message.
 But in polyalphabetic cipher there are multiple ciphertext letters for each
plaintext letter, one for each unique letter of keyword.
35. Define LFSR.
 A linear feedback shift register is a shift register whose input is a linear
function of its previous state. Also called linear recursive sequence.
36. What is prime amount?
 A prime number is an integer that can only be divided without remainder
by positive and positive values of itself and by one.

37. What is the meaning of the expression a divides b?


 Integer a is said to be a divisor of integer b if there is no remainder on
division.
38. What is Euler’s totient function?
 Euler’s totient function Φ(n) defined as the number of positive integers
less than n and
Relatively prime to n. by conversion Φ(1)=1.

Prepared By: Mrs.A.Sarkunavathi AP/IT 6


39. What is Fermat’s theorem? (May 2017)
Fermat’s theorem states the following: If p is prime and a is a positive integer not
divisible by p, then
ap-1 = 1(mod p)
where p is prime and gcd(a,p)=1

also known as Fermat’s Little Theorem

ap = p (mod p)

It is also useful in public key and primality testing

40. What is Euler’s theorem? (AU May/Jun 2014)


Euler’s theorem states that for every a and n that are relatively prime.
a Φ(n) = 1(mod n)
41. Briefly define a group.
 A group G, sometimes denoted by {G, .} is a set of elements with a binary
operation, denoted by . , that associates
42. What is the difference between a Caesar cipher and a polyalphabetic cipher?
 In caesar cipher single cipher alphabet is used per message. But in
polyalphabetic cipher there are multiple ciphertext letters for each
plaintext letter, one for each unique letter of keyword.
43. Convert the given text “Anna university” into cipher text using rail fence
technique.
 Plain text: Anna University
 Cipher text: anuiestnanvry
44. Why modular arithmetic has been used in cryptography? (AU NOV/DEC 2013)
 It is used to find multiplicative inverse in cryptography.
45. What are active and passive attacks that compromise information security?
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.
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

Prepared By: Mrs.A.Sarkunavathi AP/IT 7


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.
46. Why random numbers are used in network security? (AU May/Jun 2014)
 Nonces in authentication protocols to prevent replay
 Session keys
 Public key generation
 Key stream for a one‐time pad
47. 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
48. List the types of cryptanalytic attacks. (AU Nov/Dec 2014)
 Cipher text only
 Known plaintext
 Chosen plaintext
 Chosen cipher text
 Chosen text
49. What is the difference between a 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.
50. Decipher the following cipher text using brute force attack? (AU NOV/DEC
2014)
CMTMROOEOORW using Railfence
Solution:
CTROORMMOEOW
51. 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.

Prepared By: Mrs.A.Sarkunavathi AP/IT 8


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.
52. Determine the gcd(24140,16762) using Euclid’s algorithm.(MAY 2017)
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 Euler Totient Function ø(n).
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)
Eg: ø(37) = 36
ø(21) = (3–1)x(7–1) = 2x6 = 12
54. Define Euler's Theorem. (Nov/Dec 2009)
It is a generalisation of Fermat's Theorem
aø(n) = 1 (mod n)
For any a,n where gcd(a,n)=1
Eg: a=3;n=10; ø(10)=4;
hence 34 = 81 = 1 mod 10
a=2;n=11; ø(11)=10;
hence 210 = 1024 = 1 mod 11
55.Define Chinese Remainder Theorem
We can implement CRT in several ways to compute A(mod M)
first compute all ai = A mod mi separately
determine constants ci below, where Mi = M/mi
then combine results to get answer using:

56. What are the goals of security?


1. Prevention: It means that an attack will fail
2. Detection: It is most useful when an attack cannot be prevented, but it can also
indicate the effectiveness of preventative measures.

Prepared By: Mrs.A.Sarkunavathi AP/IT 9


3. Recovery: To stop an attack and to assess and repair any damage caused by that
attack, the system continuous to function correctly while an attack is underway.
57.Define Discrete Logarithms
The inverse problem to exponentiation is to find the discrete logarithm of a number
modulo p
that is to find x such that y = gx (mod p)
this is written as x = logg y (mod p)
if g is a primitive root then it always exists, otherwise it may not, eg.
x = log3 4 mod 13 has no answer
x = log2 3 mod 13 = 4 by trying successive powers
whilst exponentiation is relatively easy, finding discrete logarithms is generally a hard
58. What are the types of security policies?
1. Military security policy
2. Commercial security policy
3. Transaction oriented integrity security policy
4. Confidentiality security policy
5. Integrity policy
59. What are the types of access control?
1. Identity based access control
2. Mandatory access control
3. Originator controlled access control
60. What is an identity based access control?
If an individual user can set an access control mechanism to allow or deny
access to an object, that mechanism is a discretionary access control also called an
identity based access control.
61. What is a mandatory access control?
When a system mechanism controls access to an object and an individual user
can not alter that access, the control is a mandatory access control, occasionally
called as rule-based access control.

Prepared By: Mrs.A.Sarkunavathi AP/IT 10


PART - B

1. List and briefly define categories of security services.


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

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
(Table 1.2).We look at each category in turn.5

Prepared By: Mrs.A.Sarkunavathi AP/IT 11


1. 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.
2. 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).
3. 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

Prepared By: Mrs.A.Sarkunavathi AP/IT 12


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.
4. 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).

o Connection Integrity with Recovery


Provides for the integrity of all user data on a connection and detects any
modification, insertion, deletion, or replay of any data within an entire
data sequence, with recovery attempted.
o Connection Integrity without Recovery
As above, but provides only detection without recovery.
o Selective-Field Connection Integrity
Provides for the integrity of selected fields within the user data of a data
block transferred over a connection and takes the form of determination

Prepared By: Mrs.A.Sarkunavathi AP/IT 13


of whether the selected fields have been modified, inserted, deleted, or
replayed.
o Connectionless Integrity
Provides for the integrity of a single connectionless data block and may
take the form of detection of data modification. Additionally, a limited
form of replay detection may be provided.
o Selective-Field Connectionless Integrity
Provides for the integrity of selected fields within a single connectionless
data block; takes the form of determination of whether the selected fields
have been modified.
5. Non repudiation
 Non repudiation prevents either sender or receiver from denying a transmitted
message. Thus, when a message is sent, the receiver can prove that the alleged
sender in fact sent the message. Similarly, when a message is received, the
sender can prove that the alleged receiver in fact received the message.
 Note-Provides protection against denial by one of the entities involved in a
communication of having participated in all or part of the communication.
o Non repudiation, Origin
Proof that the message was sent by the specified party.
o Non repudiation, Destination
Proof that the message was received by the specified party.
7. Availability Service
 Both X.800 and RFC 2828 define availability to be the property of a system or a
system resource being accessible and usable upon demand by an authorized system
entity, according to performance specifications for the system
 A variety of attacks can result in the loss of or reduction in availability. Some of these
attacks are amenable to automated countermeasures, such as authentication and
encryption, whereas others require some sort of physical action to prevent or recover
from loss of availability of elements of a distributed system.

2. List and briefly define categories of security mechanisms. (Nov/Dec 2016)


Contents
 Introduction
 Encipherment
 Digital Signature
 Access Control

Prepared By: Mrs.A.Sarkunavathi AP/IT 14


 Data Integrity
 Authentication Exchange
 Traffic Padding
 Routing Control
 Notarization
 Pervasive Security Mechanisms
 Trusted Functionality
 Security Label
 Event Detection
 Security Audit Trail
Introduction

 The mechanisms are divided into those that are implemented in a specific
protocol layer, such as TCP or an application-layer protocol, and those that are
not specific to any particular protocol layer or security service.
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
Prepared By: Mrs.A.Sarkunavathi AP/IT 15
 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 security attributes of that resource.
Event Detection
 Detection of security-relevant events.
Security Audit Trail
 Data collected and potentially used to facilitate a security audit, which is an
independent review and examination of system records and activities.
 A reversible encipherment mechanism is simply an encryption algorithm that
allows data to be encrypted and subsequently decrypted.
 Irreversible encipherment mechanisms include hash algorithms and message
authentication codes, which are used in digital signature and message
authentication applications.
 Table 1.4, based on one in X.800, indicates the relationship between security
services and security mechanisms.

Prepared By: Mrs.A.Sarkunavathi AP/IT 16


3. List and briefly define categories of passive and active security attacks. or What
are the different types of attacks? Explain. Or Explain detail about security
attacks (NOV/DEC 2013)
Contents
 Introduction
 Passive Attacks
o The release of message contents
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, is 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 (Figure 1.2a).
Passive Attacks
 Passive attacks (Figure 1.1) 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

Prepared By: Mrs.A.Sarkunavathi AP/IT 17


that opponents, even if they captured the message, could not extract the
information from the message.

Active Attacks
 Active attacks (Figure 1.1b) 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.

Prepared By: Mrs.A.Sarkunavathi AP/IT 18


4. Explain in detail about The OSI Security Architecture.(Nov/Dec 2016)
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 mechanism: A process (or a device incorporating such a process)


that is designed to detect, prevent, or recover from a security attack.

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.
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

Prepared By: Mrs.A.Sarkunavathi AP/IT 19


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.
 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.

5. Write short notes on Network security model.


 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
Prepared By: Mrs.A.Sarkunavathi AP/IT 20
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.

 A general model of these other situations is illustrated in Figure 1.3, which


reflects a concern for protecting an information system from unwanted access.
The hacker can be someone who, with no malign intent, simply gets satisfaction
from breaking and entering a computer system.
o Programs can present two kinds of threats:
• Information access threats: Intercept or modify data on behalf of
users who should not have access to that data.

Prepared By: Mrs.A.Sarkunavathi AP/IT 21


• Service threats: Exploit service flaws in computers to inhibit use by
legitimate users.

 Viruses and worms are two examples of software attacks. They can also be
inserted into a system across a network.
 The security mechanisms needed to cope with unwanted access fall into two
broad categories (see Figure 1.3).
 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.

5. What are the essential ingredients of a symmetric cipher?


Contents
 Ingredients
 Requirements
 Cryptography
 Cryptanalysis and Brute-Force Attack
 Cryptanalysis:
 Brute-force attack:
Ingredients

A symmetric encryption scheme has five ingredients (Figure 2.1):


• Plaintext: This is the original intelligible message or data that is fed into the
algorithm as input.

Prepared By: Mrs.A.Sarkunavathi AP/IT 22


• 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 a value independent of the plaintext and of the algorithm.
• Ciphertext: This is the scrambled message produced as output. It depends on
the plaintext and the secret key.
• Decryption algorithm: This is essentially the encryption algorithm run in
reverse. It takes the ciphertext and the secret key and produces the original
plaintext.

Requirements

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.
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.
 With the use of symmetric encryption, the principal security problem is
maintaining the secrecy of the key. Let us take a closer look at the essential
elements of a symmetric encryption scheme, using Figure 2.2. A source
produces a message in plaintext, X = [X1, X2, c, XM]. The M elements of X are
letters in some finite alphabet.

Prepared By: Mrs.A.Sarkunavathi AP/IT 23


 Traditionally, the alphabet usually consisted of the 26 capital letters.
Nowadays, the binary alphabet {0, 1} is typically used. For encryption, a key of
the form K = [K1, K2, c, KJ] is generated. If the key is generated at the message
source, then it must also be provided to the destination by means of some
secure channel. With the message X and the encryption key K as input, the
encryption algorithm forms the ciphertext Y = [Y1, Y2, c, YN]. We can write this
as

 This notation indicates that Y is produced by using encryption algorithm E as a


function of the plaintext X, with the specific function determined by the value of
the key K.
 The intended receiver, in possession of the key, is able to invert the
transformation:

 An opponent, observing Y but not having access to K or X, may attempt to


recover X or K or both X and K. It is assumed that the opponent knows the
encryption (E) and decryption (D) algorithms. If the opponent is interested in
only this particular message, then the focus of the effort is to recover X by
generating a plaintext estimate
 Often, however, the opponent is interested in being able to read future
messages as well, in which case an attempt is made to recover K by generating

an estimate

Prepared By: Mrs.A.Sarkunavathi AP/IT 24


Cryptography
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 and Brute-Force Attack
There are two general approaches to attacking a conventional encryption scheme:
• Cryptanalysis: 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.
• 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.

7. What are the different substitution techniques involved in classic encryption


technique? Briefly define the Caesar cipher. Briefly define the monoalphabetic
cipher. Briefly define the Playfair cipher.(MAY 2017)
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
 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,

Prepared By: Mrs.A.Sarkunavathi AP/IT 25


 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:

Let us assign a numerical equivalent to each letter:

 Then the algorithm can be expressed as follows. For each plaintext letter p,
substitute the ciphertext letter C:

 A shift may be of any amount, so that the general Caesar algorithm is

where k takes on a value in the range 1 to 25. The decryption algorithm is


simply

 If it is known that a given ciphertext is a Caesar cipher, then a brute-force


cryptanalysis is easily performed: simply try all the 25 possible keys.
 Figure 2.3 shows the results of applying this strategy to the example ciphertext.
In this case, the plaintext leaps out as occupying the third line.
 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.

Monoalphabetic Ciphers

Prepared By: Mrs.A.Sarkunavathi AP/IT 26


 With only 25 possible keys, the Caesar cipher is far from secure. A dramatic
increase in the key space can be achieved by allowing an arbitrary substitution.
 Before proceeding, we define the term permutation. A permutation of a finite
set of elements S is an ordered sequence of all the elements of S, with each
element appearing exactly once.
 For example, if S = {a, b, c}, there are six permutations of S:
abc, acb, bac, bca, cab, cba

 If, instead, the “cipher” line can be any permutation of the 26 alphabetic
characters, then there are 26! or greater than 4 * 1026 possible keys. This is 10
orders of magnitude greater than the key space for DES and would seem to
eliminate brute-force techniques for cryptanalysis. Such an approach is referred
to as a monoalphabetic substitution cipher, because a single cipher alphabet
(mapping from plain alphabet to cipher alphabet) is used per message.
Playfair Cipher
 The best-known multiple-letter encryption cipher is the Playfair, which treats
digrams in the plaintext as single units and translates these units into
ciphertext diagrams.
 The Playfair algorithm is based on the use of a 5 * 5 matrix of letters
constructed using a keyword. Here is an example, solved by Lord Peter Wimsey
in Dorothy Sayers’s Have His Carcase:

 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
 The Hill Algorithm This encryption algorithm takes m successive plaintext
letters and substitutes for them m ciphertext 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

Prepared By: Mrs.A.Sarkunavathi AP/IT 27


 For example, 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 ciphertext for the entire plaintext is RRLMWBKASPDH.

Polyalphabetic Ciphers
 Another way to improve on the simple monoalphabetic technique is to use
different monoalphabetic substitutions as one proceeds through the plaintext
message.
 The general name for this approach is polyalphabetic substitution cipher. All
these techniques have the following features in common:
1. A set of related monoalphabetic substitution rules is used.
2. A key determines which particular rule is chosen for a given transformation.
A general equation of the encryption process is

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

Prepared By: Mrs.A.Sarkunavathi AP/IT 28


Expressed numerically, we have the following result.

One-Time Pad
 An Army Signal Corp officer, Joseph Mauborgne, proposed an improvement to
the Vernam cipher that yields the ultimate in security. Mauborgne suggested
using a random key that is as long as the message, so that the key need not be
repeated.
 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

Figure 2.7 Vernam Cipher

8. What are the different techniques involved in transposition techniques of Classical


Encryption 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.

Prepared By: Mrs.A.Sarkunavathi AP/IT 29


 The simplest such cipher is the rail fence technique, in which the plaintext is
written down as a sequence of diagonals and then read off as a sequence of
rows. For example, to encipher the message “meet me after the toga party” with
a rail fence of depth 2, we write the following:

 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

Prepared By: Mrs.A.Sarkunavathi AP/IT 30


This is a much less structured permutation and is much more difficult to
cryptanalyze.
9. What is Steganography?
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. 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.

Prepared By: Mrs.A.Sarkunavathi AP/IT 31


 Various other techniques have been used historically; some examples are
the following:
• Character marking: Selected letters of printed or typewritten text are
overwritten 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 no
visible 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,
the results of typing with the correction tape are visible only under a strong
light.
 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. 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.

10. What are the fundamental elements of branch of mathematics (Groups, Rings,
Fields)?
Contents
 Groups
 A1- Closure
 A2 - Associative
 A3 - Identity
 A4 - Inverse
 A5 - Commutative
 Rings
 M1- Closure under multiplication
 M2 - Associativity of multiplication
 M3 - Distributive law
 M4 – Commutativity of

Prepared By: Mrs.A.Sarkunavathi AP/IT 32


multiplication
 M5 – Multiplicative Identity
 M6 – No zero divisors
 Fields
 M7 – Multiplicative Inverse

 Groups, rings, and fields are the fundamental elements of a branch of


mathematics known as abstract algebra, or modern algebra.
Groups
 A group G, sometimes denoted by {G, ∙}, is a set of elements with a binary
operation denoted by ∙ that associates to each ordered pair (a, b) of elements in
G an element (a ∙ b) in G, such that the following axioms are obeyed:

 If a group has a finite number of elements, it is referred to as a finite group,


and the order of the group is equal to the number of elements in the group.
Otherwise, the group is an infinite group.
 A group is said to be abelian if it satisfies the following additional condition:

 When the group operation is addition, the identity element is 0; the inverse
element of a is -a; and subtraction is defined with the following rule: a − b = a +
(−b).
 A group G is cyclic if every element of G is a power ak (k is an integer) of a fixed
element a € G. The element a is said to generate the group G or to be a
generator of G. A cyclic group is always abelian and may be finite or infinite.
Rings
 A ring R, sometimes denoted by {R, +, *}, is a set of elements with two binary
operations, called addition and multiplication, such that for all a, b, c in R
the following axioms are obeyed.

Prepared By: Mrs.A.Sarkunavathi AP/IT 33


 In essence, a ring is a set in which we can do addition, subtraction [a - b = a +
(-b)], and multiplication without leaving the set.
 A ring is said to be commutative if it satisfies the following additional
condition:

 Next, we define an integral domain, which is a commutative ring that obeys


the following axioms.

Fields
 A field F, sometimes denoted by {F, +, *}, is a set of elements with two binary
operations, called addition and multiplication, such that for all a, b, c in F the
following axioms are obeyed.

 In essence, a field is a set in which we can do addition, subtraction,


multiplication, and division without leaving the set. Division is defined with the
following rule: a/b = a(b-1).

11. Discuss in detail about Modular arithmetic. What are the various operations
involved in Modular Arithmetic.
Contents
 The Modulus
 Properties of Congruences
 Modular Arithmetic Operations

Prepared By: Mrs.A.Sarkunavathi AP/IT 34


 Properties of Modular Arithmetic
The Modulus
 If a is an integer and n is a positive integer, we define a mod n to be the
remainder when a is divided by n. The integer n is called the modulus. Thus, for
any integer a, we can rewrite Equation (4.1) as follows:

 Two integers a and b are said to be congruent modulo n, if (a mod n) = (b mod


n). This is written as a K b (mod n).

Properties of Congruences
Congruences have the following properties:

To demonstrate the first point, if n | (a - b), then (a - b) = kn for some k.


 So when b is divided by n) = (b mod n). we can write a = b + kn. Therefore, (a
mod n) = (remainder when b + kn is divided by n) = remainder

The remaining points are as easily proved.


Modular Arithmetic Operations
 Note that, by definition (Figure 4.1), the (mod n) operator maps all integers into
the set of integers {0, 1, c, (n - 1)}. this technique is known as modular
arithmetic.
Modular arithmetic exhibits the following properties:

Properties of Modular Arithmetic


Define the set Zn as the set of nonnegative integers less than n:

Prepared By: Mrs.A.Sarkunavathi AP/IT 35


This is referred to as the set of residues, or residue classes (mod n). To be more
precise, each integer in Zn represents a residue class. We can label the residue classes
(mod n) as [0], [1], [2], c, [n - 1], where

12.Explain the Euclid’s algorithm

Contents
 Introduction
 Greatest Common Divisor
 Finding the Greatest Common
Divisor
Introduction

 One of the basic techniques of number theory is the Euclidean algorithm, which
is a simple procedure for determining the greatest common divisor of two
positive integers. First, we need a simple definition: Two integers are relatively
prime if their only common positive integer factor is 1.
Greatest Common Divisor
 Recall that nonzero b is defined to be a divisor of a if a = mb for some m, where
a, b, and m are integers.
 We will use the notation gcd(a, b) to mean the greatest common divisor of a
and b. The greatest common divisor of a and b is the largest integer that divides
both a and b.

Prepared By: Mrs.A.Sarkunavathi AP/IT 36


 We also define gcd(0, 0) = 0. More formally, the positive integer c is said to be
the greatest common divisor of a and b if
1. c is a divisor of a and of b.
2. Any divisor of a and b is a divisor of c.

An equivalent definition is the following:

 Because we require that the greatest common divisor be positive, gcd(a, b) =


gcd(a, −b) = gcd(−a, b) = gcd(−a,−b). In general, gcd(a, b) = gcd( |a| , |b|).

Finding the Greatest Common Divisor


 Suppose we have integers a, b such that d = gcd(a, b). Because gcd gcd( |a| ,
|b|) = gcd(a, b), there is no harm in assuming a ≥ b > 0. Now dividing a by b
and applying the division algorithm, we can state:

 Let us now return to Equation (4.2) and assume that r1 ≠ 0. Because b > r1, we
can divide b by r1 and apply the division algorithm to obtain:

The result is the following system of equations:

Let us now look at an example with relatively large numbers to see the power of this algorithm:

Prepared By: Mrs.A.Sarkunavathi AP/IT 37


 In this example, we begin by dividing 1160718174 by 316258250, which gives 3
with a remainder of 211943424. Next we take 316258250 and divide it by
211943424. The process continues until we get a remainder of 0, yielding a
result of 1078.
13. List three classes of polynomial arithmetic.

Contents
 Ordinary Polynomial Arithmetic
 Polynomial Arithmetic with Coefficients
in Zp
 Finding the Greatest Common Divisor
 Modular Polynomial Arithmetic

The three classes of polynomial arithmetic.


 Ordinary polynomial arithmetic, using the basic rules of algebra.
 Polynomial arithmetic in which the arithmetic on the coefficients is performed
modulo p; that is, the coefficients are in GF(p).
 Polynomial arithmetic in which the coefficients are in GF(p), and the
polynomials are defined modulo a polynomial m(x) whose highest power is some
integer n.

1. Ordinary Polynomial Arithmetic


 A polynomial of degree n (integer n Ú 0) is an expression of the form

 Where the ai are elements of some designated set of numbers S, called the
coefficient set, and an _ 0. We say that such polynomials are defined over the
coefficient set S. A zero-degree polynomial is called a constant polynomial and
is simply an element of the set of coefficients.
 An nth-degree polynomial is said to be a monic polynomial if an = 1.
 Addition and subtraction are performed by adding or subtracting corresponding
coefficients. Thus, if

then addition is defined as

Prepared By: Mrs.A.Sarkunavathi AP/IT 38


and multiplication is defined as

2. Polynomial Arithmetic with Coefficients in Zp


 Let us now consider polynomials in which the coefficients are elements of some
field F; we refer to this as a polynomial over the field F. In that case, it is easy to
show that the set of such polynomials is a ring, referred to as a polynomial
ring.
 That is, if we consider each distinct polynomial to be an element of the set, then
that set is a ring

Finding the Greatest Common Divisor


 We can extend the analogy between polynomial arithmetic over a field and
integer arithmetic by defining the greatest common divisor as follows. The
polynomial c(x) is said to be the greatest common divisor of a(x) and b(x) if the
following are true.
1. c(x) divides both a(x) and b(x).
2. Any divisor of a(x) and b(x) is a divisor of c(x).

 Figure 4.4 shows an example of polynomial arithmetic over GF(2). For f(x) = (x 7
+ x5 + x4 + x3 + x + 1) and g(x) = (x3 + x + 1), the figure shows f(x) + g(x); f(x) -
g(x); f(x) * g(x); and f(x)/g(x). Note that g(x) | f(x).

3. Modular Polynomial Arithmetic

Prepared By: Mrs.A.Sarkunavathi AP/IT 39


 Consider the set S of all polynomials of degree n - 1 or less over the field Zp.
Thus, each polynomial has the form

 With the appropriate definition of arithmetic operations, each such set S is a


finite field. The definition consists of the following elements.

1. Arithmetic follows the ordinary rules of polynomial arithmetic using the basic
rules of Algebra, with the following two refinements.
2. Arithmetic on the coefficients is performed modulo p. That is, we use the
rules of arithmetic for the finite field Zp.
3. If multiplication results in a polynomial of degree greater than n - 1, then the
polynomial is reduced modulo some irreducible polynomial m(x) of degree n.
 That is, we divide by m(x) and keep the remainder. For a polynomial f(x), the
remainder is expressed as r(x) = f(x) mod m(x).

14. What is a prime numbers?


 An integer p > 1 is a prime number if and only if its only divisors are ±1 and ± p.
Prime numbers play a critical role in number theory.. In particular, note the
number of primes in each range of 100 numbers.
Any integer a > 1 can be factored in a unique way as

 where p1 < p2< …..< pt are prime numbers and where each ai is a positive
integer. This is known as the fundamental theorem of arithmetic; a proof can be
found in any text on number theory.

 It is useful for what follows to express this another way. If P is the set of all
prime numbers, then any positive integer a can be written uniquely in the
following form:

 The right-hand side is the product over all possible prime numbers p; for any
particular value of a, most of the exponents ap will be 0.

Prepared By: Mrs.A.Sarkunavathi AP/IT 40


 The value of any given positive integer can be specified by simply listing all the
nonzero exponents in the foregoing formulation.

 Multiplication of two numbers is equivalent to adding the corresponding

exponents. Given
 Define k = ab. We know that the integer k can be expressed as the product of

powers of primes: .
It follows that kp = ap + bp for all

 What does it mean, in terms of the prime factors of a and b, to say that a
divides b? Any integer of the form pn can be divided only by an integer that is of
a lesser or equal power of the same prime number, p j with j ≤ n. Thus, we can
say the following.
Given

It is easy to determine the greatest common divisor of two positive integers if we


express each integer as the product of primes.

The following relationship always holds:

Determining the prime factors of a large number is no easy task, so the


preceding relationship does not directly lead to a practical method of calculating the
greatest common divisor.

Prepared By: Mrs.A.Sarkunavathi AP/IT 41


15. Using Fermat’s theorem, find a mod p. What is Euler’s totient function?
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 (8.2), which completes the proof.

 An alternative form of Fermat’s theorem is also useful: If p is prime and a is a


positive integer, then

 Note that the first form of the theorem [Equation (8.2)] requires that a be
relatively prime to p, but this form does not.

Euler’s Totient Function

Prepared By: Mrs.A.Sarkunavathi AP/IT 42


 Before presenting Euler’s theorem, we need to introduce an important quantity
in number theory, referred to as Euler’s totient function, written f(n), and
defined as the number of positive integers less than n and relatively prime to n.
By convention, f(1) = 1.
 It should be clear that, for a prime number p,

 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:
 Equation (8.4) is true if n is prime, because in that case, 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:

The set S is a permutation of R, by the following line of reasoning:


1. Because a is relatively prime to n and xi is relatively prime to n, axi must also
be relatively prime to n. Thus, all the members of S are integers that are less
than n and that are relatively prime to n.
2. There are no duplicates in S. Refer to Equation (4.5). If axi mod n = axj mod n,
then xi = xj.
Therefore,
Prepared By: Mrs.A.Sarkunavathi AP/IT 43
 which 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:

16. The Miller-Rabin test can determine if a number is not prime but cannot
determine if a number is prime. How can such an algorithm be used to test for
primality?
Contents
 Testing for primality
 Miller-Rabin Algorithm
 Two Properties of Prime Numbers
 Details of the Algorithm
 A Deterministic Primality Algorithm
 Distribution of Primes
Testing for primality
o Miller-Rabin Algorithm
 The algorithm due to Miller and Rabin [MILL75, RABI80] is typically used to test
a large number for primality. Before explaining the algorithm, we need some
background.
 First, any positive odd integer n ≥ 3 can be expressed as

Two Properties of Prime Numbers


The first property is stated as follows:
o If p is prime and a is a positive integer less than p, then a2 mod p = 1
if and only if either a mod p = 1 or a mod p = −1 mod p = p −1. By the
rules of modular arithmetic (a mod p) (a mod p) = a2 mod p.
The second property is stated as follows:

Prepared By: Mrs.A.Sarkunavathi AP/IT 44


1. aq is congruent to 1 modulo p. That is, aq mod p = 1, or equivalently,
aq ≡1(mod p).
2. One of the numbers aq, a2q a2k-lq is congruent to −1 modulo p.
Details of the Algorithm
 The procedure TEST takes a candidate integer n as input and returns the result
composite if n is definitely not a prime, and the result inconclusive if n may or
may not be a prime.

A Deterministic Primality Algorithm


 All of the algorithms in use, including the most popular (Miller-Rabin),
produced a probabilistic result.
 AKS developed a relatively simple deterministic algorithm that efficiently
determines whether a given large number is a prime. The algorithm, known as
the AKS algorithm, does not appear to be as efficient as the Miller- Rabin
algorithm.
Distribution of Primes
 A result from number theory, known as the prime number theorem, states that
the primes near n are spaced on the average one every ln(n) integers.
 Thus, on average, one would have to test on the order of ln(n) integers before a
prime is found. Because all even integers can be immediately rejected, the
correct figure is 0.5 ln(n).
17. A common formulation of the Chinese remainder theorem (CRT) is as follows: Let
m1,…, mk be integers that are pairwise relatively prime for 1 ≤ i, j ≤ k, and i ≠ j. Define
M to be the product of all the mi′s. Let a1,…. , ak be integers. Then the set of
congruences:
x ≡ a1(mod m1)
x ≡ a2(mod m2)
.
x ≡ ak(mod mk)
has a unique solution modulo M. Show that the theorem stated in this form is
true.(May 2017)

Prepared By: Mrs.A.Sarkunavathi AP/IT 45


Contents
 The Chinese remainder theorem
 The First Assertion of the
CRT
 Second Assertion of the CRT
The Chinese remainder theorem
 One of the most useful results of number theory is the Chinese remainder
theorem (CRT).8 In essence, the CRT says it is possible to reconstruct integers
in a certain range from their residues modulo a set of pairwise relatively prime
moduli.
 The CRT can be stated in several ways. We present here a formulation that is
most useful from the point of view of this text. An alternative formulation is
explored in Problem 8.17. Let

 where the mi are pairwise relatively prime; that is, gcd(mi, mj) = 1 for 1 ≤ i, j ≤ k,
and i ≠ j. We can represent any integer A in ZM by a k-tuple whose elements are
in Zmi using the following correspondence:

 where A € ZM, ai _ Zmi, and ai = A mod mi for 1 ≤ i ≤ k.


The CRT makes two assertions.
1. The mapping of Equation (8.7) is a one-to-one correspondence (called a
bijection) between ZM and the Cartesian product Zm1 × Zm2 ×…..× Zmk.
2. Operations performed on the elements of ZM can be equivalently performed
on the corresponding k-tuples by performing the operation independently in
each coordinate position in the appropriate system.
Let us demonstrate the first assertion. The transformation from A to (a1, a2,…, ak),
is obviously unique; that is, each ai is uniquely calculated as ai = A mod mi.

 By the definition of Mi, it is relatively prime to mi and therefore has a unique


multiplicative inverse mod mi. So Equation (8.8) is well defined and produces a
unique value ci.
We can now compute

Prepared By: Mrs.A.Sarkunavathi AP/IT 46


 To show that the value of A produced by Equation (8.9) is correct, we must
show that ai = A mod mi for 1 ≤ i ≤ k. Note that cj ≡ Mj ≡ 0 (mod mi) if j ≠ i, and
that ci ≡ 1 (mod mi). It follows that ai = A mod mi.
The second assertion of the CRT, concerning arithmetic operations, follows from the
rules for modular arithmetic. That is, the second assertion can be stated as follows: If

 One of the useful features of the Chinese remainder theorem is that it provides
a way to manipulate (potentially very large) numbers mod M in terms of tuples
of smaller numbers. This can be useful when M is 150 digits or more. However,
note that it is necessary to know beforehand the factorization of M.

18. What is Discrete logarithms?


Contents
 Introduction
 The Powers of an Integer, Modulo n
 Logarithms for Modular Arithmetic
 Calculation of Discrete Logarithms
Introduction

 Discrete logarithms are fundamental to a number of public-key algorithms,


including Diffie-Hellman key exchange and the digital signature algorithm
(DSA).
The Powers of an Integer, Modulo n
 Recall from Euler’s theorem [Equation (8.4)] that, for every a and n that are
relatively prime,

 where φ(n), Euler’s totient function, is the number of positive integers less than
n and relatively prime to n. Now consider the more general expression:

Prepared By: Mrs.A.Sarkunavathi AP/IT 47


 If a and n are relatively prime, then there is at least one integer m that satisfies
Equation (8.10), namely, M = φ(n). The least positive exponent m for which
Equation (8.10) holds is referred to in several ways:
• The order of a (mod n)
• The exponent to which a belongs (mod n)
• The length of the period generated by a
 Table 8.3 shows all the powers of a, modulo 19 for all positive a < 19. The
length of the sequence for each base value is indicated by shading. Note the
following:
1. All sequences end in 1. This is consistent with the reasoning of the preceding
few paragraphs.
2. The length of a sequence divides φ(19) = 18. That is, an integral number of
sequences occur in each row of the table.
3. Some of the sequences are of length 18. In this case, it is said that the base
integer a generates (via powers) the set of nonzero integers modulo 19. Each
such integer is called a primitive root of the modulus 19.

Logarithms for Modular Arithmetic


 With ordinary positive real numbers, the logarithm function is the inverse of
exponentiation.An analogous function exists for modular arithmetic.
 The logarithm of a number is defined to be the power to which some positive
base (except 1) must be raised in order to equal the number. That is, for base x
and for a value y,

The properties of logarithms include

Prepared By: Mrs.A.Sarkunavathi AP/IT 48


 Consider a primitive root a for some prime number p (the argument can be
developed for nonprimes as well). Then we know that the powers of a from 1
through (p - 1) produce each integer from 1 through (p - 1) exactly once. We
also know that any integer b satisfies

 By the definition of modular arithmetic. It follows that for any integer b and a
primitive root a of prime number p, we can find a unique exponent i such that

 This exponent i is referred to as the discrete logarithm of the number b for the
base a (mod p).We denote this value as dloga,p(b).
Note the following:

Calculation of Discrete Logarithms


Consider the equation

 Given g, x, and p, it is a straightforward matter to calculate y. At the worst, we


must perform x repeated multiplications, and algorithms exist for achieving
greater efficiency.

Anna University Questions

PART-A

1. Briefly define the Caesar cipher. (NOV/DEC 2012)


2. Explain the avalanche effect (NOV/DEC 2012)
3. What is the difference between a mono alphabetic cipher and a polyalphabetic cipher
4.What is the difference between a Caesar cipher and a polyalphabetic
cipher?(NOV/DEC 2012)
5. Briefly define the Playfair cipher? (MAY/JUNE 2011)
6. What are the two general approaches to attacking a cipher? (MAY/JUNE 2011)

Prepared By: Mrs.A.Sarkunavathi AP/IT 49


7. Convert the given text “anna university” into cipher text using rail fence technique.
8. Define Steganography. (MAY/JUNE 2013)
9. Give an example each for substitution and transposition ciphers. (NOV/DEC 2013)
10. Why modular arithmetic has been used in cryptography? (NOV/DEC 2013)
11. What are active and passive attacks that compromise information security?
12. Why random numbers are used in network security? (AU May/Jun 2014)
13. State Euler’s theorem. (AU May/Jun 2014)
14. What are the two basic functions used in encryption algorithms?
17. List the types of cryptanalytic attacks. (AU Nov/Dec 2014)
18. What is the difference between a block cipher and a stream cipher?
19. Decipher the following cipher text using brute force attack? (AU NOV/DEC 2014)
20. State fermat’s theorem. (AU May-June 2017)
21. Determine the gcd(24140,16762) using Euclid’s algorithm. (AU May-June 2017)
PART-B
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 2011) (Nov/Dec 2012)
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)

Prepared By: Mrs.A.Sarkunavathi AP/IT 50


Prepared By: Mrs.A.Sarkunavathi AP/IT 51
Prepared By: Mrs.A.Sarkunavathi AP/IT 52
Prepared By: Mrs.A.Sarkunavathi AP/IT 53
Prepared By: Mrs.A.Sarkunavathi AP/IT 54

You might also like