Unit I - Moodle
Unit I - Moodle
UNIT - I
Introduction to Cryptography
UNIT-I 1. 1
Paavai Institutions Department of IT
CONTENTS
1. INTRODUCTION
UNIT-I 1. 2
Paavai Institutions Department of IT
TECHINICAL TERMS
Technical
S.No Term Literal Meaning Digester
Meaning
The art of
science
concerning the
principles,
means, and
The art of writing or methods for
deciphering messages in rendering plain
1 Cryptography http://www.yourdictionary.com/
code text
unintelligible
and for
converting
encrypted
messages into
intelligible form
A condition that
results from the
establishment
and maintenance
Security Being free from danger, of protective
2 http://www.yourdictionary.com/
or feeling safe measures that
ensures a state of
inviolability
from hostile acts
or influences.
Network security
is protection of
the access to
files and
Protecting the computer
Network directories in a
systems in the network
3 Security computer http://www.yourdictionary.com/
from unwanted
network against
intrusions.
hacking, misuse
and unauthorized
changes to the
system.
Assuring
information will
be kept secret,
State of being secret or of
4 Confidentiality with access http://www.yourdictionary.com/
keeping secrets.
limited to
appropriate
persons.
UNIT-I 1. 3
Paavai Institutions Department of IT
Specifies only
Following of moral or the authorized
Integrity ethical principles, and parties can
5 http://www.yourdictionary.com/
doing the same as what modify the
you say. computer system
assets.
Security
measures
designed to
verify or validate
the identity of a
user or station
Something which
Authentication prior to granting
6 validates or confirms the http://www.yourdictionary.com/
access to
authenticity of something
resources.
Authentication
mechanisms
include
passwords and
intelligent tokens
Referring to a
mechanism that
proves that the
originating node
sent a message
and that the
Assurance that a contract
Non- receiving node
cannot later be denied by
7 Repudiation received it. http://www.yourdictionary.com/
either of the parties
Therefore, the
involved
sender cannot
deny sending the
message and the
receiver cannot
deny having
received it
A means of
controlling
permitting or denying the access by users
Access control
8 use of a particular to computer http://www.yourdictionary.com/
resource systems or to
data on a
computer system
Specifies that
whether someone or resources or
Availability
9 something can be information http://www.yourdictionary.com/
accessed or used should be
available to
UNIT-I 1. 4
Paavai Institutions Department of IT
authorized
parties at all
times.
An attempt to
act of making a physical
bypass security
10 Attack or verbal attempt to hurt http://www.yourdictionary.com/
controls on a
or destroy
computer
Attempts to
make use of
Passive attacks No Modification of data
11 system resources http://www.yourdictionary.com/
stream
without affecting
it.
Attempt to alter
Active attacks Modification of data system resources
12 http://www.yourdictionary.com/
stream or affect their
operation
The art of
recovering
original data
(the plaintext)
that has been
encrypted
(turned into
cipher text)
The act or science of
without having
deciphering a code or
access to the
13 Cryptanalysis coded message without a http://www.yourdictionary.com/
correct key used
prior knowledge of the
in the encryption
key
process. When
new encryption
algorithms are
introduced,
cryptanalysis
determines how
hard it is to
break the code
Trying all
possible keys on
Brute force decrypted
14 Powerful attack http://www.yourdictionary.com/
attack message to
recover the
original message
Data comprising
standard
Plain text Not encrypted text; text
15 characters (e.g., http://www.yourdictionary.com/
that is readable.
letters, numbers,
and punctuation
UNIT-I 1. 5
Paavai Institutions Department of IT
marks), with no
formatting codes
Scrambled
or
Cipher text Encrypted text; text that
16 unintelligible http://www.yourdictionary.com/
is not readable
message
produced as
output.
UNIT-I 1. 6
Paavai Institutions Department of IT
1. INTRODUCTION
Computer data often travels from one computer to another, leaving the safety of its
protected physical surroundings. Once the data is out of hand, people with bad intention could
modify or forge your data, either for amusement or for their own benefit.
Cryptography can reformat and transform our data, making it safer on its trip between
computers. The technology is based on the essentials of secret codes, augmented by modern
mathematics that protects our data in powerful ways.
• Computer Security - generic name for the collection of tools designed to protect
data and to thwart hackers
To assess effectively the security needs of an organization and to evaluate and choose
various security products and policies, the manager responsible for security needs some
systematic way of defining the requirements for security and characterizing the approaches to
satisfying those requirements. The OSI security architecture was developed in the context of
the OSI protocol architecture.
For these purposes, the OSI security architecture provides a useful, if abstract,
overview of many of the concepts. The OSI security architecture focuses on security attacks,
mechanisms, and services. These can be defined briefly as follows
Threat
UNIT-I 1. 9
10
Paavai Institutions Department of IT
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
UNIT-I 1. 11
Paavai Institutions Department of IT
o Security attack – Any action that compromises the security of information owned
by an organization.
o Security service – A service that enhances the security of the data processing
systems and the information transfers of an organization. The services are intended
to counter security attacks and they make use of one or more security mechanisms
to provide the service.
UNIT-I 1. 12
Paavai Institutions Department of IT
Interception
An unauthorized party gains access to an asset. This is an attack on confidentiality.
Unauthorized party could be a person, a program or a computer.e.g., wire tapping to capture
data in the network, illicit copying of files
Modification
An unauthorized party not only gains access to but tampers with an asset. This is an attack on
integrity. e.g., changing values in data file, altering a program, modifying the contents of
messages being transmitted in a network.
UNIT-I 1. 13
Paavai Institutions Department of IT
Fabrication
An unauthorized party inserts counterfeit objects into the system. This is an attack on
authenticity. e.g., insertion of spurious message in a network or addition of records to a file
Active attacks
Passive attack 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.
Passive attacks are of two types:
Active attacks
These attacks involve some modification of the data stream or the creation of a false stream.
These attacks can be classified in to four categories:
Masquerade – One entity pretends to be a different entity.
UNIT-I 1. 14
Paavai Institutions Department of IT
Replay – involves passive capture of a data unit and its subsequent transmission to
produce an unauthorized effect.
Public key
In symmetric key algorithms, the encryption and decryption keys are known both to sender
and receiver. The encryption key is shared and the decryption key is easily calculated from it.
In many cases, the encryption and decryption keys are the same. In public key cryptography,
encryption key is made public, but it is computationally infeasible to find the decryption key
without the information known to the receiver.
UNIT-I 1. 15
Paavai Institutions Department of IT
Here the original message, referred to as plaintext, is converted into apparently random
nonsense, referred to as cipher text. The encryption process consists of an algorithm and a
key. The key is a value independent of the plaintext. Changing the key changes the output of
the algorithm. Once the cipher text is produced, it may be transmitted. Upon reception, the
cipher text can be transformed back to the original plaintext by using a decryption algorithm
and the same key that was used for encryption. The security depends on several factors. First,
the encryption algorithm must be powerful enough that it is impractical to decrypt a message
on the basis of cipher text alone. Beyond that, the security depends on the secrecy of the key,
not the secrecy of the algorithm.
• Two requirements for secure use of symmetric encryption:
– a strong encryption algorithm
Y = EK(X) X = DK(Y)
UNIT-I 1. 15
Paavai Institutions Department of IT
A source produces a message in plaintext, X = [X1, X2, … , XM] where M are the number of
letters in the message. A key of the form K = [K1, K2, …, KJ] is generated. If the key is
generated at the source, then it must 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
cipher text Y = [Y1, Y2, …, YN]. This can be expressed as
Y = EK(X)
The intended receiver, in possession of the key, is able to invert the transformation:
X = DK(Y)
Cryptography
Cryptographic systems are generally classified along 3 independent dimensions:
Type of operations used for transforming plain text to cipher text
All the encryption algorithms are based on two general principles: substitution, in
which each element in the plaintext is mapped into another element, and
transposition, in which elements in the plaintext are rearranged.
UNIT-I 1. 16
Paavai Institutions Department of IT
Known plaintext – The cryptanalyst has a copy of the cipher text and the
corresponding plaintext.
Chosen cipher text – The cryptanalyst obtains temporary access to the decryption
machine, uses it to decrypt several string of symbols, and tries to use the results to
deduce the key.
Integrity: Ensures that only authorized parties are able to modify computer system assets
and transmitted information. Modification includes writing, changing status, deleting,
creating and delaying or replaying of transmitted messages.
Non repudiation: Requires that neither the sender nor the receiver of a message be able
to deny the transmission
Access control: Requires that access to information resources may be controlled by or
the target system.
Availability: Requires that computer system assets be available to authorized parties
when needed.
UNIT-I 1. 18
Paavai Institutions Department of IT
A message is to be transferred from one party to another across some sort of internet.
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 principles.
using this model requires us to:
– design a suitable algorithm for the security transformation
– specify a protocol enabling the principals to use the transformation and secret
information for a security service.
UNIT-I 1. 19
Paavai Institutions Department of IT
1.7.1Substitution techniques
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
UNIT-I 1. 20
Paavai Institutions Department of IT
involves replacing plaintext bit patterns with cipher text bit patterns.
(i)Caesar ciphers (or) shift cipher The earliest known use of a substitution cipher and the
simplest was by Julius Caesar. The Caesar cipher involves replacing each letter of the
alphabet with the letter standing 3 places further down the alphabet.
e.g., plain text: pay more money
Cipher text: SDB PRUH PRQHB Note that the alphabet is wrapped around, so that
letter following
„z‟ is „a‟. For each plaintext letter p, substitute the cipher text letter c such that
C = E(p) = (p+3) mod 26 A shift may be any amount, so
that general Caesar algorithm is
C = E (p) = (p+k) mod 26
Where k takes on a value in the range 1 to 25. The decryption algorithm is
simply P = D(C) = (C-k) mod 26
(ii)Playfair cipher The best known multiple letter encryption cipher is the playfair, which
treats diagram in the plaintext as single units and translates these units into cipher text
diagram.
The playfair algorithm is based on the use of 5x5 matrix of letters constructed using a
keyword. Let the keyword be „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 alphabetical order.
The letter i and j count as one letter. Plaintext is encrypted two letters at a time according to
the following rules:
Repeating plaintext letters that would fall in the same pair are separated with a filler
letter such as „x.
Plaintext letters that fall in the same row of the matrix are each replaced by the letter
to the right, with the first element of the row following the last.
Plaintext letters that fall in the same column are replaced by the letter beneath, with
the top element of the column following the last.
Otherwise, each plaintext letter is replaced by the letter that lies in its own row and the
UNIT-I 1. 21
Paavai Institutions Department of IT
Since there are 26 letters, 26x26 = 676 diagrams are possible, so identification of
individual diagram is more difficult.
(iv)Vigenere cipher In this scheme, the set of related monoalphabetic substitution rules
consisting of 26 caesar ciphers with shifts of 0 through 25. Each cipher is denoted by a key
letter. e.g., Caesar cipher with a shift of 3 is denoted by the key value 'd‟ (since a=0, b=1,
c=2 and so on). To aid in understanding the scheme, a matrix known as vigenere tableau is
constructed.
UNIT-I 1. 22
Paavai Institutions Department of IT
PLAINTEXT
K a b c d e f g h I J K … x y z
E a A B C D E F G H I J K … X Y Z
Y b B C D E F G H I J K L … Y Z A
c C D E F G H I J K L M … Z A B
L d D E F G H I J K L M N … A B C
E e E F G H I J K L M N O … B C D
T
f F G H I J K L M N O P … C D E
T
g G H I J K L M N O P Q … D E F
E
. . . . . . . . . . . … . . .
R . . . . . . . . . . . . . .
S . . . . . . . . . . . . . .
x X Y Z A B C D E F G H … W
y Y Z A B C D E F G H I … X
z Z A B C D E F G H I J … Y
Each of the 26 ciphers is laid out horizontally, with the key letter for each cipher to its left.
A normal alphabet for the plaintext runs across the top. The process of encryption is simple:
Given a key letter X and a plaintext letter y, the cipher text is at the intersection of the row
labeled x and the column labeled y; in this case, the ciphertext is V. To encrypt a message, a
key is needed that is as long as the message. Usually, the key is a repeating keyword. e.g.,
key = d e c e p t i v e d e c e p t i v e d e c e p t i v e
PT = w e a r e d i s c o v e r e d s a v e y o u r s e l f
CT =
ZICVTWQNGRZGVTWAVZHCQYGLMGJ
Decryption is equally simple. The key letter again identifies the row. The position of the
cipher text letter in that row determines the column, and the plaintext letter is at the top of
that column.
Strength of Vigenere cipher
There are multiple ciphertext letters for each plaintext letter.
UNIT-I 1. 23
Paavai Institutions Department of IT
Thus the cipher text is generated by performing the bitwise XOR of the plaintext and the key.
Decryption uses the same key. Because of the properties of XOR, decryption simply involves
the same bitwise operation:
Pi = Ci ®Ki
e.g., plaintext = 0 0 1 0 1 0 0 1
Key = 1 0 1 0 1 1 0 0
ciphertext = 1 0 0 0 0 1 0 1
Advantage:
Encryption method is completely unbreakable for a ciphertext only
attack. Disadvantages
It requires a very long key which is expensive to produce and expensive to transmit.
Once a key is used, it is dangerous to reuse it for a second message; any knowledge on
the first message would give knowledge of the second.
All the techniques examined so far involve the substitution of a cipher text symbol for a
plaintext symbol. A very different kind of mapping is achieved by performing some sort of
UNIT-I 1. 24
Paavai Institutions Department of IT
Rail fence is simplest of such cipher, in which the plaintext is written down as a sequence of
diagonals and then read off as a sequence of rows.
To encipher this message with a rail fence of depth 2, we write the message as follows:
m eat ecol os
e tthshoh ue
MEATECOLOSETTHSHOHUE
Row Transposition Ciphers-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 columns then becomes the key of the algorithm.
house Key = 4 3 1 2 5 6 7
PT = m e e t a t t
h esc hoo
l house
CT = ESOTCUEEHMHLAHSTOETO
A pure transposition cipher is easily recognized because it has the same letter frequencies as
the original plaintext. The transposition cipher can be made significantly more secure by
performing more than one stage of transposition. The result is more complex permutation that
is not easily reconstructed.
UNIT-I 1. 25
Paavai Institutions Department of IT
1.7.3 Steganography
A plaintext message may be hidden in any one of the two ways. 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. e.g., (i) the sequence of first letters of each word of the overall message spells out
the real (hidden) message. (ii) Subset of the words of the overall message is used to convey
the hidden message. Various other techniques have been used historically, some of them are
Character marking – selected letters of printed or typewritten text are overwritten in
pencil. The marks are ordinarily not visible unless the paper is held to 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 in front of the light.
Typewritten correction ribbon – used between the lines typed with a black ribbon, the
results of typing with the correction tape are visible only under a strong light.
Drawbacks of steganography
Requires a lot of overhead to hide a relatively few bits of information.
Once the system is discovered, it becomes virtually worthless.
An efficient method to modify the plain text into an encoded cipher text , not easily
predictable ensuring that the key value is irrecoverable when data is attacked while being
transmitted. If a data is lost or extra bit gets added while transmission, the system will
automatically show error as all the processes are synchronised. To avoid data being modified
while transmission, different types of feedback function for 100 characters(3-bit sequence
specific and different for adjacent row and column input devices in the register shown in
figure 4; arranged in a 10 * 10 matrix) having different bit sequence is devised. Two stage
password check(one of them being device specific) is used for decoding the message.
Converting the data to its ASCII value, one character at a time, using a 2^8 x 8 priority
encoder (1 byte per character), the 8-bit sequence is stored in an 8-bit right shift register M
UNIT-I 1. 26
Paavai Institutions Department of IT
(PARALLEL IN). Then a shift control input is introduced with the clock pulse having an octal
word-time signal so that number pulse is equal to the number of bits in the shift register.
(word - time signal-figure 1, circuit diagram-figure 2). The shift register has got a 0-bit
feedback(in figure 3). When the input bits are shifted towards right, 0-bit enters from the
leftmost register so that at the end of the 8th clock pulse the content of 8-bit register is
refreshed back to 0. The output mode is SERIALLY OUT.
UNIT-I 1. 27
Paavai Institutions Department of IT
Cryptanalysis
The process of attempting to discover X or K or both is known as cryptanalysis.
The strategy used by the cryptanalysis depends on the nature of the encryption scheme and the
information available to the cryptanalyst.
There are various types of cryptanalytic attacks based on the amount of information
known to the
cryptanalyst.
Cipher text only – A copy of cipher text alone is known to the cryptanalyst.
Known plaintext – The cryptanalyst has a copy of the cipher text and the
corresponding plaintext.
Chosen plaintext – The cryptanalysts gains temporary access to the encryption
machine. They cannot open it to find the key, however; they can encrypt a large
number of suitably chosen plaintexts and try to use the resulting cipher texts to deduce
the key.
Chosen cipher text – The cryptanalyst obtains temporary access to the decryption
machine, uses it to decrypt several string of symbols, and tries to use the results to
deduce the key.
QUESTION BANK
PART A
UNIT-I 1. 28
Paavai Institutions Department of IT
PART- B
UNIT-I 1. 29
Paavai Institutions Department of IT
References:
http://www.youtube.com/watch?v=6iNnzCEXyEo
http://www.youtube.com/watch?v=rA_ZmWPormM
http://freevideolectures.com/Course/3027/Cryptography-and-Network-Security
http://www.youtube.com/watch?v=ijC2-JHz6Z4
http://www.youtube.com/watch?v=UgFoqxKY7cY
UNIT-I 1. 30