1
1
1
UNIT 1 NOTES
Security trends – Legal, Ethical and Professional Aspects of Security, Need for Security at
Multiple levels, Security Policies – Model of network security – Security attacks, services
mechanisms – OSI security architecture – Classical encryption techniques: substitution techniques,
transposition techniques, steganography- Foundations of modern cryptography: perfect security –
information theory – product cryptosystem – cryptanalysis.
Definition
Cryptography is the science of using mathematics to encrypt and decrypt data.
Phil Zimmermann
Cryptography is the art and science of keeping messages secure.
Bruce Schneier
The art and science of concealing the messages to introduce secrecy in information
Security is recognized as cryptography.
It is the study and practice of techniques for secure communication in the presence of third parties
called adversaries. Data Confidentiality, Data Integrity, Authentication and Non-repudiation are
core principles of modern-day cryptography.
Terminologies
A message is plaintext (sometimes called clear text). The process of disguising a message in such
a way as to hide its substance is encryption. An encrypted message is cipher text. The process of
turning cipher text back into plaintext is decryption.
Security Trends
Definition of Computer Security
Confidentiality
Data confidentiality
Assures that private or confidential information is not made available or disclosed to unauthorized
Privacy
Assures that individuals control or influence what information related to them may be collected
and stored and by whom and to whom that information may be disclosed.
Integrity
Data integrity
Assures that information and programs are changed only in a specified and authorized manner.
System integrity
Assures that a system performs its intended function in an unimpaired manner, free from deliberate
or inadvertent unauthorized manipulation of the system.
Availability
Assures that systems work promptly and service is not denied to authorize users.
Confidentiality
Preserving authorized restrictions on information access and disclosure, including means for
protecting personal privacy and proprietary information.
A loss of confidentiality is the unauthorized disclosure of information.
Integrity
Some organizations go as far as to purchase dedicated systems for each security level. This is
often prohibitively expensive, however. A mechanism is required to enable users at different
security levels to access systems simultaneously, without fear of information contamination.
The term multi-level arises from the defense community's security classifications: Confidential,
Secret, and Top Secret.
Individuals must be granted appropriate clearances before they can see classified information.
Those with Confidential clearance are only authorized to view Confidential documents; they are
not trusted to look at Secret or Top Secret information. The rules that apply to data flow operate
from lower levels to higher levels, and never the reverse. This is illustrated below.
Under such a system, users, computers, and networks use labels to indicate security
levels. Data can flow between like levels, for example between "Secret" and "Secret", or from a
lower level to a higher level. This means that users at level "Secret" can share data with one
another, and can also retrieve information from Confidential-level (i.e., lower-level), users.
However, data cannot flow from a higher level to a lower level. This prevents processes at the
"Secret" level from viewing information classified as "Top Secret". It also prevents processes at
MLS access rules are always combined with conventional access permissions (file
permissions). For example, if a user with a security level of "Secret" uses Discretionary Access
Control (DAC) to block access to a file by other users, this also blocks access by users with a
security level of "Top Secret". A higher security clearance does not automatically give
permission to arbitrarily browse a file system.
As discussed above, subjects and objects are labeled with Security Levels (SLs), which
are composed of two types of entities:
An SL must have one sensitivity, and may have zero or more categories.
Examples of SLs are: { Secret / UFO, Crypto }, { Top Secret / UFO, Crypto, Stargate }
and { Unclassified }
Note the hierarchical sensitivity followed by zero or more categories. The reason for
having categories as well as sensitivities is so that sensitivities can be further compartmentalized
on a need-to-know basis.
Security Polices
Following are some points which help in security policy of an organization.
User policies
IT policies.
When you compile a security policy you should have in mind a basic structure in order to make
something practical. Some of the main points which have to be taken into consideration are −
Types of Policies
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.
All the techniques for providing security have two components:
A security-related transformation on the information to be sent.
Examples: encryption of the message, addition of a code based on the contents
Some secret information shared by the two principals, unknown to the opponent
Example: encryption key used in conjunction with the transformation
A trusted third party may be needed to achieve secure transmission.
for distributing the secret information to the two principals
to arbitrate disputes between the two principals concerning the authenticity of a message
transmission
Protecting an information system from unwanted access from hacker, intruder hacker who, with
no malign intent, simply gets satisfaction from breaking and entering a computer system.
Intruder can be a disgruntled employee who wishes to do damage or a Criminal who seeks to
exploit computer assets for financial gain
placement in a computer system of logic that exploits vulnerabilities in the system and that can
affect application programs as well as utility programs, such as editors and compilers
Two kinds of threats:
o Information access threats: Intercept or modify data on behalf of users who should not have
access
o Service threats: Exploit service flaws in computers to inhibit use by legitimate users
Examples: Viruses and worms, spread using disks & inserted over network
A telephone
conversation, an
electronic mail
message, and a
transferred file may
contain sensitive or
Traffic Analysis
observe the pattern of these messages
The opponent could determine the location and identity of communicating hosts and could
observe the frequency and length of messages being exchanged.
This information might be useful in guessing the nature of the communication that was
taking place
Active Attacks
Active attacks involve some modification of the data stream or the creation of a false
stream
detect and to recover from any disruption or delays caused by them
can be subdivided into four categories:
o masquerade,
o replay,
o modification of messages
o denial of service
Masquerade
one entity pretends to be a different
entity
usually includes one of
the other forms of active
attack
Example
A message meaning “Allow John Smith to read confidential file accounts” is modified to
mean “Allow Fred Brown to read confidential file accounts.”
Denial of Service
Prevents or inhibits the
normal use or
management of
communications facilities
May have a specific target;
for example, an entity may
suppress all messages
directed to a particular
destination
Disruption of an entire
network, either by disabling
the network or by overloading
it with messages so as to
degrade performance
o Data-Origin Authentication
Access control
The prevention of unauthorized use of a resource
Data confidentiality
The protection of data from unauthorized disclosure.
Four Types
o Connection Confidentiality
o Connectionless Confidentiality
o Selective-Field Confidentiality
o Traffic-Flow Confidentiality
Data integrity
The assurance that data received are exactly as sent by an authorized entity (i.e., contain
no modification, insertion, deletion, or replay).
Five types
o Connection Integrity with Recovery
o Connection Integrity without Recovery
o Selective-Field Connection Integrity
o Connectionless Integrity
o Selective-Field Connectionless Integrity
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.
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 Recovery
Deals with requests from mechanisms, such as event handling and management functions, and
takes recovery actions.
o Playfair Cipher
o Hill Cipher
o Polyalphabetic Ciphers
o One-Time Pad
Transposition Techniques
Rotor Machines
Steganography
Introduction
Symmetric encryption is a form of cryptosystem in which encryption and decryption are
performed using the same key. It is also known as conventional encryption.
Symmetric encryption transforms plaintext into ciphertext using a secret key and an
encryption algorithm. Using the same key and a decryption algorithm, the plaintext is
recovered from the ciphertext.
The two types of attack on an encryption algorithm are cryptanalysis,based on properties
of the encryption algorithm, and brute-force, which involves trying all possible keys.
Traditional (precomputer) symmetric ciphers use substitution and/or transposition
techniques. Substitution techniques map plaintext elements (characters, bits) into
ciphertext elements. Transposition techniques systematically transpose the positions of
plaintext elements.
Rotor machines are sophisticated precomputer hardware devices that use substitution
techniques.
Steganography is a technique for hiding a secret message within a larger one in such a way
that others cannot discern the presence or contents of the hidden message.
An original message is known as the plaintext, while the coded message is called the
ciphertext.
The process of converting from plaintext to ciphertext is known as enciphering or
encryption; restoring the plaintext from the ciphertext is deciphering or decryption.
The many schemes used for encryption constitute the area of study known as
cryptography. Such a scheme is known as a cryptographic system or a cipher.
Techniques used for deciphering a message without any knowledge of the enciphering
details fall into the area of cryptanalysis. Cryptanalysis is what the layperson calls
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 a value independent of
the plaintext and of the algorithm. 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.
Ciphertext: This is the scrambled message produced as output. It depends on the plaintext and the
secret key. For a given message, two different keys will produce two different cipher texts. The cipher
text is an apparently random stream of data and, as it stands, is unintelligible.
Decryption algorithm: This is essentially the encryption algorithm run in reverse. It takes the cipher
text and the secret key and produces the original plaintext
A source produces a message in plaintext, X = [X1, X2, ..., XM]. The M elements of X are
letters in some finite alphabet. 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, ..., 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. Alternatively, a third party
could generate the key and securely deliver it to both source and destination.
With the message X and the encryption key K as input, the encryption algorithm forms the
ciphertext Y = [Y1, Y2, ..., YN]. We can write this as
Y = E(K, X)
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:
X = D(K, Y)
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)
Substitution 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 involves
replacing plaintext bit patterns with ciphertext bit patterns
1. 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,
plain: meet me after the toga party
cipher: PHHW PH DIWHU WKH WRJD SDUWB
Note that the alphabet is wrapped around, so that the letter following Z is A.
plain: a b c d e f g h i j k l m n o p q r s t u v w x y z
cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y z
13 14 15 16 17 18 19 20 21 22 23 24 25
C = E(k, p) = (p + k) mod 26
p = D(k, C) = (C - k) mod 26
Exercise:
Monoalphabetic Ciphers
• Rather than just shifting the alphabet shuffle (jumble) the letters arbitrarily
• Each plaintext letter maps to a different random ciphertext letter
• Hence key is 26 letters long
• The “cipher” line can be any permutation of the 26 alphabetic characters, then there are
26! or greater than 4x1026 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
• Monoalphabetic ciphers are easy to break because they reflect the frequency data of the
original alphabet
• A countermeasure is to provide multiple substitutes, known as homophones, for a single
letter.
• For example, the letter e could be assigned a number of different cipher symbols, such as
16, 74, 35, and 21, with each homophone assigned to a letter in rotation or randomly
Language Redundancy and Cryptanalysis
• human languages are redundant
• eg "th lrd s m shphrd shll nt wnt"
• letters are not equally commonly used
• in English E is by far the most common letter
• followed by T,R,N,I,O,A,S
• other letters like Z,J,K,Q,X are fairly rare
• have tables of single, double & triple letter frequencies for various languages
• two-letter combinations, known as digrams (ex: th)
2. Playfair Cipher
The best-known multiple-letter encryption cipher is the Playfair. The Playfair algorithm is based
on the use of a 5×5 matrix of letters constructed using a keyword.
Playfair Key Matrix
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
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. Plaintext is encrypted two letters at a time, according to the following rules:
1. Repeating plaintext letters that are in the same pair are separated with a filler letter, such as x,
so that balloon would be treated as ba lx lo on.
2. Two plaintext letters that fall in the same row of the matrix are each replaced by the letter to
the right, with the first element of the row circularly following the last. For example, ar is
encrypted as RM.
3. Two plaintext letters that fall in the same column are each replaced by the letter beneath, with
the top element of the column circularly following the last. For example, mu is encrypted as CM.
4. Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and
the column occupied by the other plaintext letter. Thus, hs becomes BP and ea becomes IM / JM.
Example
Given the key MONARCHY apply Play fair cipher to plain text “FACTIONALISM”
Solution
(p) FA CT IO NA LI SM
(c) IO DL FA AR SE LA
(d) FA CT IO NA LI SM
Security of Playfair Cipher
security much improved over monoalphabetic since have 26 x 26 = 676 digrams
would need a 676 entry frequency table to analyse and correspondingly more ciphertext
was widely used for many years eg. by US & British military in WW1
it can be broken, given a few hundred letters since still has much of plaintext structure
3. Hill Cipher
Another interesting multiletter cipher is the Hill cipher, developed by the mathematician Lester Hill in 1929.
This encryption algorithm takes successive M plaintext letters and substitutes for them M ciphertext letters.
The substitution is determined by linear equations in which each character is assigned a numerical value
(a=0, b=1, c=2,......, z=25). For M=3, the system can be described as
Example:
15 15 375 11
0 then, K 0 = 879 mod26 = 13 = LNS
24 24 486 18
Exercise:
2 5 3 Key :
3 1 4
9 7 6
Cipher Text : ?
Example
4. 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.
5. Vigenere Cipher
Example:
Key : deceptive
Plain Text : we are discovered yourself
key: deceptivedeceptivedeceptive
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGRZGVTWAVZHCQYGLMGJ
Exercise:
Plaintext : cryptography and network security
Key : sectionb
Ciphertext : ?
keyword can be eliminated by using a nonrepeating keyword that is as long as the message itself.Vigenère
proposed what is referred to as an autokey system, in which a keyword is concatenated with the plaintext
itself to provide a running key. For our example,
key: deceptivewearediscoveredsav
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGKZEIIGASXSTSLVVWLA
Exercise:
Plaintext : cryptography and network security
Key : sectionb
Ciphertext : ?
6. One-Time Pad
improvement to the Vernam cipher that yields the ultimate in security
using a random key that is as long as the message, so that the key need not be repeated
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 Example
ciphertext:ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS key:
pxlmvmsydofuyrvzwc tnlebnecvgdupahfzzlmnyih plaintext: mr mustard with the
candlestick in the hall
ciphertext:ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS key:
mfugpmiydgaxgoufhklllmhsqdqogtewbqfgyovuhwt plaintext: miss scarlet
with the knife in the library two fundamental difficulties
problem of making large quantities of random keys
problem of key distribution and protection
Key: 4 3 1 2 5 6 7
Input: t t n a a pt
m t s u o ao
Steganography
We conclude with a discussion of a technique that is, strictly speaking, not encryption, namely,
steganography
A plaintext message may be hidden in one of two ways.
The methods of steganography conceal the existence of the message
The methods of cryptography render the message unintelligible to outsiders
o by various transformations of the text
Various ways to conceal the message
Arrangement of words or letters within an apparently innocuous text spells out the real
message
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
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
Hiding a message by using the least significant bits of frames on a CD
The Kodak Photo CD format's maximum resolution is 2048 by 3072 pixels, with each
pixel containing 24 bits of RGB color information.
can be employed by parties who have something to lose should the fact of their secret
communication be discovered
Encryption flags traffic as important or secret or may identify the sender or receiver as
someone with something to hide
Randomizer R
Eavesdropper
X Y Y X
PlainText Encrypter Decrypter Cipher Tesxt
Z Z
S
Secure Channel
Random
Z
Source
Key Source
1. Secret sharing schemes such as Shamir's are information-theoretically secure (and also
perfectly secure) in that having less than the requisite number of shares of
the secret provides no information about the secret.
2. More generally, secure multiparty computation protocols often have information-
theoretic security.
3. Private information retrieval with multiple databases can be achieved with information-
theoretic privacy for the user's query.
4. Symmetric encryption can be constructed under an information-theoretic notion of
security called entropic security, which assumes that the adversary knows almost nothing
about the message being sent. The goal here is to hide all functions of the plaintext rather
than all information about it.
5. Quantum cryptography is largely part of information-theoretic cryptography.
Product Cryptosystem
Two of the first kinds of cryptosystems that we considered were simple substitution ciphers and
permutation ciphers. Each of them quickly proved vulnerable to attack. We now consider a new
kind of cryptosystem that is based on them but which is considerably more difficult to attack; so
difficult, in fact, that most modern cryptosystems are of the type we now consider. A product
cryptosystem is a block cipher that repeatedly performs substitutions and permutations, one after
the other, to produce ciphertext.
Example : DES and AES (Brief description in Unit II)
It may be used in information warfare applications - for example, forging an encrypted signal to
be accepted as authentic. Competitors who have been able to discover the key will now want to
use it to their advantage, therefore they will want to send bogus encrypted messages to the source
in order to gain information or gain an advantage. It could also be used to pretend to be the
source in order to send bogus information to others, who now will think that it came from the
official source.
Ciphertext Only
A ciphertext only attack (COA) is a case in which only the encrypted message is available for
attack, but because the language is known a frequency analysis could be attempted. In this
situation the attacker does not know anything about the contents of the message, and must work
from ciphertext only.
In a known plaintext attack (KPA) both the plaintext and matching ciphertext are available for
use in discovering the key.
The attacker knows or can guess the plaintext for some parts of the ciphertext. For example,
maybe all secure login sessions begin with the characters LOGIN, and the next transmission may
be PASSWORD. The task is to decrypt the rest of the ciphertext blocks using this information.
This may be done by determining the key used to encrypt the data, or via some shortcut.
A chosen plaintext attack (CPA) occurs when the attacker gains access to the target encryption
device - if, for example, it is left unattended. The attacker then runs various pieces of plaintext
though the device for encryption. This is compared to the plaintext to attempt to derive the key.
In an adaptive chosen plaintext attack (ACPA), the attacker not only has access to the plaintext
and its encryption, but can adapt or modify the chosen plaintext as needed based on results of the
previous encryptions.
In a chosen ciphertext attack (CCA), the cryptanalyst can choose different ciphertexts to be
decrypted and has access to the decrypted plaintext.
This type of attack is generally applicable to attacks against public key cryptosystems.
Two schemes
Unconditionally secure
If the ciphertext generated by the scheme does not contain enough information to determine
uniquely the corresponding plaintext, no matter how much ciphertext is available
Computationally secure
meets either of the following criteria:
o The cost of breaking the cipher exceeds the value of the encrypted information.
o The time required to break the cipher exceeds the useful lifetime of the information.
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.