Unit1 CS8792 CNS Notes PEC
Unit1 CS8792 CNS Notes PEC
Unit1 CS8792 CNS Notes PEC
UNIT I INTRODUCTION
Security trends - Legal, Ethical and Professional Aspects of Security, Need for Security at
Multiple Levels, Security Policies - Model of Network Security - Security Attacks, Services and
Mechanisms - OSI security architecture - classical encryption techniques: substitution
techniques, transposition techniques, steganography - Foundations of modern cryptography:
perfect security - information theory - product cryptosystem - cryptanaysis
• Accountability: The security goal that generates the requirement for actions of an entity to be
traced uniquely to that entity. This supports non repudiation, deterrence, fault isolation, intrusion
detection and prevention, and after-action recovery and legal action.
• Computer Security - Generic name for the collection of tools designed to protect data and to
thwart hackers.
• Network Security - Measures to protect data during their transmission.
• Internet Security - Measures to protect data during their transmission over a collection of
interconnected networks Our Focus is on Internet Security which consists of measures to deter,
prevent, detect and correct security violations that involve the transmission and storage of
information
Computer and network security is both fascinating and complex. Some of the reasons follow:
1. Security is not as simple as it might first appear to the novice. The requirements seem to be
straightforward; indeed, most of the major requirements for security services can be given self-
explanatory, one-word labels: confidentiality, authentication, non repudiation, or integrity
3. Typically, a security mechanism is complex, and it is not obvious from the statement of a
particular requirement that such elaborate measures are needed.
4. Having designed various security mechanisms, it is necessary to decide where to use them.
This is true both in terms of physical placement and in a logical sense
.
5. Security mechanisms typically involve more than a particular algorithm or protocol
6. Computer and network security is essentially a battle of wits between a perpetrator who tries
to find holes and the designer or administrator who tries to close them. The great advantage
that the attacker has is that he or she need only find a single weakness, while the designer must
find and eliminate all weaknesses to achieve perfect security.
7. There is a natural tendency on the part of users and system managers to perceive little
benefit from security investment until a security failure occurs.
8. Security requires regular, even constant, monitoring, and this is difficult in today‟s short-term,
overloaded environment.
9. Security is still too often an afterthought to be incorporated into a system after the design is
complete rather than being an integral part of the design process.
10. Many users and even security administrators view strong security as an impediment to
efficient and user-friendly operation of an information system or use of information.
Computers as storage devices: Computers can be used to further unlawful activity by using a
computer or a computer device as a passive storage medium. For example, the computer can
be used to store stolen password lists, credit card details and proprietary corporate information.
Computers as communications tools: Many of the crimes falling within this category are
simply traditional crimes that are committed online. Examples include the illegal sale of
prescription drugs, controlled substances, alcohol, and guns; fraud; gambling; and child
pornography. Other than these crimes there are more specific crimes in computer networks.
There are:
Illegal access: The access to the whole or any part of a computer system without right.
Illegal interception: The interception without right, made by technical means, of non-public
transmissions of computer data to, from or within a computer system, including electromagnetic
emissions from a computer system carrying such computer data.
Data interference: The damaging, deletion, deterioration, alteration or suppression of computer
data without right.
System interference: The serious hindering without right of the functioning of a computer
system by inputting, transmitting, damaging, deleting, deteriorating, altering or suppressing
computer data.
Computer-related forgery: The input, alteration, deletion, or suppression of computer data,
resulting in inauthentic data with the intent that it be considered or acted upon for legal purposes
as if it were authentic, regardless whether or not the data is directly readable and intelligible.
Crime related to child pornography: Producing child pornography or distribution through a
computer system and making available or distributing or transmitting child pornography through
a computer system.
The relative lack of success in bringing cyber-criminals to justice has led to an increase in their
numbers, boldness, and the global scale of their operations. It is difficult to profile cybercriminals
in the way that is often done with other types of repeat offenders. The success of cybercriminals
and the relative lack of success of law enforcement, influence the behaviour of cybercrime
victims. As with law enforcement, many organizations that may be the target of attack have not
invested sufficiently in technical, physical, and human-factor resources to prevent attacks.
The law is used regulate people for their own good and for the greater good of society.
Cryptography also regulated activity.
Some Example laws which are forced on cryptography.
Control use of cryptography: Closely related to restrictions on content are restrictions on the
use of cryptography imposed on users in certain countries. For examples, 2 In China, state
council order 273 requires foreign organizations or individuals to apply permission to use
encryption in China. Pakistan requires that all encryption hardware and software be inspected
and approved by the Pakistan telecommunication authority.
Cryptography and Free speech: The Cryptography involve not just products, it involves ideas
too, although governments effectively control the flow of products across borders, controlling the
floe ideas either head or on the internet, is also impossible.
Cryptography and Escrow: Although laws enable governments to read encrypted
communications. In 1996, US government offered to relax the export restriction for so called
escrowed encryption, in which the government would able to obtain the encryption key for any
encrypted communication.
Downloaded from: annauniversityedu.blogspot.com
CS8792 - CRYPTOGRAPHY AND NETWORK SECURITY YEAR IV SEM 07 PANIMALAR ENGG COLLEGE
The victory in use of law enforcement depends much more on technical skills of the people.
Management needs to understand the criminal investigation process, the inputs that
investigators need, and the ways in which the victim can contribute positively to the
investigation.
1.2.2 Intellectual Properties.
There are three main types of intellectual property for which legal protection is available.
Copy rights: Copyright law protects the tangible or fixed expression of an idea, not the idea
itself. Copy right properties exists when proposed work is original and creator has put original
idea in concrete form and the copyright owner has these exclusive rights, protected against
infringement such as reproduction right, modification right, distribution right
Patents: A patent for an invention is the grant of a property right to the inventor. There are 3
types in patents:-
• Utility (any new and useful process, machine, article of manufacture, or composition of
matter).
• Design (new, original, and ornamental design for an article of manufacture)
• Plant (discovers and asexually reproduces any distinct and new variety of plant).
Trade-Marks: A trademark is a word, name, symbol or expression which used to identify the
products or services in trade uniquely from others. Trade mark rights used to prevent others
from using a confusingly similar mark, but not to prevent others from making the same goods or
from selling the same goods or services under a clearly different mark.
• Intellectual Property Relevant to Network and Computer Security
A number of forms of intellectual property are relevant in the context of network and
computer security.
• Software programs: software programs are protected by using copyright, perhaps
patent.
• Digital content: audio / video / media / web protected by copy right
Algorithms: algorithms may be able to protect by patenting
• Privacy Law and Regulation: An issue with considerable overlap with computer security
is that of privacy. Concerns about the extent to which personal privacy has been and
may be compromised have led to a variety of legal and technical approaches to
reinforcing privacy rights. A number of international organizations and national
governments have introduced laws and regulations intended to protect individual
privacy.
• European Union Data Protection Directive was adopted in 1998 to ensure member
states protect fundamental privacy rights when processing personal info and prevent
member states from restricting the free flow of personal info within EU organized around
principles of notice, consent, consistency, access, security, onward transfer and
enforcement. US Privacy Law have Privacy Act of 1974 which permits individuals to
determine records kept, forbid records being used for other purposes, obtain access to
records, ensures agencies properly collect, maintain, and use personal info and creates
a private right of action for individuals.
Cryptography and Ethics.
• There are many potential misuses and abuses of information and electronic
communication that create privacy and security problems. Ethics refers to a system of
moral principles that relates to the benefits and harms of particular actions. An ethic an
objectively defined standard of right and wrong. Ethical standards are often idealistic
principles because they focus on one objective. Even though religious group and
professional organization promote certain standards of ethical behaviour, ultimately each
person is responsible for deciding what do in a specific situation.
1.2.3 Ethical issues related to computer and info systems
Computers have become the primary repository of both personal information and negotiable
assets, such as bank records, securities records, and other financial information.
Repositories and processors of information: Unauthorized use of otherwise unused
computer services or of information stored in computers raises questions of appropriateness or
fairness.
Producers of new forms and types of assets: For example, computer programs are entirely
new types of assets, possibly not subject to the same concepts of ownership as other assets.
Symbols of intimidation and deception: The images of computers as thinking machines,
absolute truth producers, infallible, subject to blame, and as anthropomorphic replacements of
humans who err should be carefully considered.
1.3 NEED FOR SECURITY AT MULTIPLE LEVELS
Multilevel security or multiple levels of security (MLS) is the application of a computer system to
process information with incompatible classifications (i.e., at different security levels), permit
access by users with different security clearances and needs-to-know, and prevent users from
obtaining access to information for which they lack authorization.
There are two contexts for the use of multilevel security.
One is to refer to a system that is adequate to protect itself from subversion and has robust
mechanisms to separate information domains, that is, trustworthy.
Another context is to refer to an application of a computer that will require the computer to be
strong enough to protect itself from subversion and possess adequate mechanisms to separate
information domains, that is, a system we must trust. This distinction is important because
systems that need to be trusted are not necessarily trustworthy.
A threat is an object, person, or other entity that represents a constant danger to an asset.
1.3.1 Security Policies
The Cryptography Policy sets out when and how encryption should be used. It includes
protection of sensitive information and communications, key management, and procedures to
ensure encrypted information can be recovered by the organisation if necessary.
Role of the Security Policy in Setting up Protocols
Following are some pointers which help in setting u protocols for the security policy of an
organization.
Who should have access to the system?
How it should be configured?
How to communicate with third parties or systems?
Acceptance User Policy − This policy regulates the behavior of the users towards a
system or network or even a webpage, so it is explicitly said what a user can do and
cannot in a system. Like are they allowed to share access codes, can they share
resources, etc.
User Account Policy − This policy defines what a user should do in order to have or
maintain another user in a specific system. For example, accessing an e-commerce
webpage. To create this policy, you should answer some questions such as −
o Should the password be complex or not?
o What age should the users have?
o Maximum allowed tries or fails to log in?
o When the user should be deleted, activated, blocked?
Information Protection Policy − This policy is to regulate access to information, hot to
process information, how to store and how it should be transferred.
Remote Access Policy − This policy is mainly for big companies where the user and their
branches are outside their headquarters. It tells what should the users access, when they
can work and on which software like SSH, VPN, RDP.
Firewall Management Policy − This policy has explicitly to do with its management, which
ports should be blocked, what updates should be taken, how to make changes in the
firewall, how long should be the logs be kept.
Special Access Policy − This policy is intended to keep people under control and monitor
the special privileges in their systems and the purpose as to why they have it. These
employees can be team leaders, managers, senior managers, system administrators, and
such high designation based people.
Network Policy − This policy is to restrict the access of anyone towards the network
resource and make clear who all will access the network. It will also ensure whether that
person should be authenticated or not. This policy also includes other aspects like, who will
authorize the new devices that will be connected with network? The documentation of
network changes. Web filters and the levels of access. Who should have wireless
connection and the type of authentication, validity of connection session?
Email Usage Policy − This is one of the most important policies that should be done
because many users use the work email for personal purposes as well. As a result
information can leak outside. Some of the key points of this policy are the employees
should know the importance of this system that they have the privilege to use. They should
not open any attachments that look suspicious. Private and confidential data should not be
sent via any encrypted email.
Software Security Policy − This policy has to do with the software’s installed in the user
computer and what they should have. Some of the key points of this policy are Software of
the company should not be given to third parties. Only the white list of software’s should be
allowed, no other software’s should be installed in the computer. Warez and pirated
software’s should not be allowed.
A model for much of what we will be discussing is captured, in very general terms, in
Figure 1.3. A message is to be transferred from one party to another across some sort of
Internet service.
A security-related transformation on the information to be sent, Examples include the
encryption of the message, which scrambles the message so that it is unreadable by the
opponent, and the addition of a code based on the contents of the message, which can be used
to verify the identity of the sender
Some secret information shared by the two principals and, it is hoped, unknown to the
opponent. An example is an encryption key used in conjunction with the transformation to
scramble the message before transmission and unscramble it on reception.
A general model of these other situations is illustrated by Figure 1.4, which reflects a
concern for protecting an information system from unwanted access. Most readers are familiar
with the concerns caused by the existence of hackers, who attempt to penetrate systems that
can be accessed over a network. The hacker can be someone who, with no malign intent,
simply gets satisfaction from breaking and entering a computer system. The intruder can be a
disgruntled employee who wishes to do damage or a criminal who seeks to exploit computer
assets for financial gain (e.g., obtaining credit card numbers or performing illegal money
transfers).
Another type of unwanted access is the 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. 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.
• Service threats: Exploit service flaws in computers to inhibit use by legitimate users.
Viruses and worms are two examples of software attacks. Such attacks can be introduced into a
system by means of a disk that contains the unwanted logic concealed in otherwise useful
software.
The security mechanisms needed to cope with unwanted access fall into two broad
categories (see Figure 1.4).The first category might be termed a gatekeeper function. It includes
password-based login procedures that are designed to deny access to all but authorized users
and screening logic that is designed to detect and reject worms, viruses, and other similar
attacks. Once either an unwanted user or unwanted software gains access,
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.
1.5 THE OSI SECURITY ARCHITECTURE
ITU-T Recommendation X.800, Security Architecture for OSI, defines such a systematic
approach. The OSI security architecture is useful to managers as a way of organizing the task
of providing security. This architecture was developed as an international standard, computer
and communications vendors have developed security features for their products and services
that relate to this structured definition of services and mechanisms.
The OSI security architecture focuses on security attacks, mechanisms, and services.
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. In the literature, the terms threat and attack are commonly used to mean
more or less the same thing.
•
Table 1.1 provides definitions taken from RFC 2828, InternetSecurity Glossary.
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 a 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.
1.5.1 ATTACKS
The security attacks can be classified into two types’ 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
Two types of passive attacks are the release of message contents and traffic analysis.
A second type of passive attack, traffic analysis, is subtler (Figure 1.5b). Suppose that
we had a way of masking the contents of messages or other information traffic so that
opponents, even if they captured the message, could not extract the information from the
message. The common technique for masking contents is encryption. If we had encryption
protection in place, an opponent might still be able to observe the pattern of these messages.
Passive attacks are very difficult to detect, because they do not involve any alteration of the
data. Typically, the message traffic is not sent and received in an apparently normal fashion and
the sender nor receiver is aware that a third party has read the messages or observed the traffic
pattern.
Active Attacks
Active attacks 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 takes place when one entity pretends to be a different entity (Figure 1.6a). A
masquerade attack usually includes one of the other forms of active attack. For example,
authentication sequences can be captured and replayed after a valid authentication sequence
has taken place, thus enabling an authorized entity with few privileges to obtain extra privileges
by impersonating an entity that has those privileges.
Replay involves the passive capture of a data unit and its subsequent retransmission to
produce an unauthorized effect (Figure 1.6b).
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 (Figure 1.6c). For
example, a message meaning “Allow John Smith to read confidential file accounts” is modified
to mean “Allow Fred Brown to read confidential file account.
The denial of service prevents or inhibits the normal use or management of communications
facilities (Figure 1.6d). This attack may have a specific target.
Active attacks present the opposite characteristics of passive attacks. Whereas passive attacks
are difficult to detect, measures are available to prevent their success.
1.5.2 SERVICES
1.5.3 MECHANISMS
Table 1.3 lists the security mechanisms defined in X.800. 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
• 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 “breaking the code” The areas of
cryptography and cryptanalysis together are called cryptology.
• 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
ciphertexts. The ciphertext 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.
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. This requirement is usually stated in a
stronger form: The opponent should be unable to decrypt ciphertext or discover the key even if
he or she is in possession of a number of ciphertexts together with the plaintext that produced
each ciphertext.
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 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 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 K to X or, 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 X. 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 K.
1.6.2 Cryptography
Cryptographic systems are characterized along three independent dimensions:
1. The number of keys used. 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 use different keys, the system is referred to as asymmetric, two-key, or public-key
encryption.
2. The way in which the plaintext is processed. 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.
3. Cryptanalysis and Brute-Force Attack
Typically, the objective of attacking an encryption system is to recover the key in use rather than
simply to recover the plaintexts of a single ciphertext. There are two general approaches to
attacking a conventional encryption scheme:
• Cryptanalysis: Cryptanalytic attacks rely on the nature of the algorithm plusperhaps some
knowledge of the general characteristics of the plaintext oreven some sample plaintext–
ciphertext pairs. This type of attack exploits the characteristics of the algorithm to attempt to
deduce a specific plaintext or to deduce the key being used.
• Brute-force attack: The attacker tries every possible key on a piece of cipher text until an
intelligible translation into plaintext is obtained. On average, half of all possible keys must be
tried to achieve success.
Table 1.4 summarizes the various types of cryptanalytic attacks based on the amount of
information known to the cryptanalyst. The most difficult problem is presented when all that is
available is the ciphertext only.
A brute-force attack involves trying every possible key until an intelligible translation of the
ciphertext into plaintext is obtained.
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. We can define the
transformation by listing all possibilities, as follows:
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
Then the algorithm can be expressed as follows. For each plaintext letter, substitute the cipher
text letter:
C = E(3, p) = (p + 3) mod 26
A shift may be of any amount, so that the general Caesar algorithm is
C = E(k, p) = (p + k) mod 26
where takes on a value in the range 1 to 25.The decryption algorithm is simply
p = D(k, C) = (C - k) mod 26
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. 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.
2. Monoalphabetic Ciphers
With only 25 possible keys, the Caesar cipher is far from secure.A dramatic increasein
the key space can be achieved by allowing an arbitrary substitution. A permutation of a finite
set of elements is an ordered sequence of all the elements of, with each element appearing
exactlyonce. For example, if S ={a,b,c} , there are six permutations of :
abc, acb, bac, bca, cab, cba
In general, there are n! permutations of a set of elements, because the first element can
be chosen in one of n ways, the second in n-1 ways, the third in n-2 ways, and so on.
Recall the assignment for the Caesar cipher:
plain: a b c d e f g h I j kl 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
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 alphabetto cipher alphabet) is used per message.
The ciphertext to be solved is
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
As a first step, the relative frequency of the letters can be determined and compared to a
standard frequency distribution for English, such as is shown in Figure 1.9. If the message were
long enough, this technique alone might be sufficient, but because this is a relatively short
message, we cannot expect an exact match. In any case, the relative frequencies of the letters
in the ciphertext (in percentages) are as follows:
That cipher letters P and Z are the equivalents of plain letters e and t, but it is not certain
which is which. The letters S, U, O, M, and H are all of relatively high frequency and probably
correspond to plain letters from the set {a, h, i, n, o, r, s}. The letters with the lowest frequencies
(namely A, B, G, Y, I, J) are likely included in the set {b, j, k, q, v, x, z}.
A powerful tool is to look at the frequency of two-letter combinations, known as digrams.
The most common such digram is th. In our ciphertext, the most common digram is ZW, which
appears three times. So we make the correspondence of Z with t and W with h. Then, by our
earlier hypothesis, we can equate P with e. Now notice that the sequence ZWP appears in the
ciphertext, and we can translate that sequence as “the.” This is the most frequent trigram (three-
letter combination). Next, notice the sequence ZWSZ in the first line. We do not know that these
four letters form a complete word, but if they do, it is of the form th_t. If so, Sequates with a.
So far, then, we have
Only four letters have been identified, but already we have quite a bit of the message.
Continued analysis of frequencies plus trial and error should easily yield a solution from this
point. The complete plaintext, with spaces added between words, follows:
it was disclosed yesterday that several informal but
direct contacts have been made with political
representatives of the viet cong in moscow
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.
3. 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 digrams. 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 inDorothy 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. 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 (or
JM, as the encipherer wishes).
The Playfair cipher is a great advance over simple monoalphabetic ciphers. For one thing,
whereas there are only 26 letters, there are 26 × 26 = 676 digrams, so that identification of
individual digrams is more difficult. Furthermore, the relative frequencies of individual letters
exhibit a much greater range than that of digrams, making frequency analysis much more
difficult. For these reasons, the Playfair cipher was for a long time considered unbreakable. It
was used as the standard field system by the British Army in World War I and still enjoyed
considerable use by the U.S. Army and other Allied forces during World War II.
4. Hill Cipher
Another interesting multiletter cipher is the Hill cipher, developed by the mathematician
Lester Hill in 1929. Define the inverse M-1of a square matrix M by the equation M(M-1)= M-1M=I,
where I is the identity matrix. I is a square matrix that is all zeros except for ones along the main
diagonal from upper left to lower right. The inverse of a matrix does not always exist, but when
The determinant is k11k22 -k12k21. For a 3×3 matrix, the value of the determinant is
.k11k22k33 + k21k32k13 + k31k12k23 - k31k22k13 - k21k12k33 - k11k32k23. If a square matrix A has a
nonzero determinant, then the inverse of the matrix is computed as [A-1]ij=(det A)-1 (-1)i+j
(Dij)where (Dij ) is the subdeterminant formed by deleting the jth row and the ith column of A,
det(A) is the determinant of A, and (det A)-1 is the multiplicative inverse of (det A) mod 26.
Continuing our example,
THE HILLALGORITHM 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,…z=25). For m=3, the system can
be described as
This can be expressed in terms of row vectors and matrices:
or
C = PK mod 26
where C and P are row vectors of length 3 representing the plaintext and ciphertext, and K is a
3 ×3 matrix representing the encryption key. Operations are performed mod 26.For example,
consider the plaintext “paymoremoney” and use the encryption Key
As with Playfair, the strength of the Hill cipher is that it completely hides single-letter
frequencies. Indeed, with Hill, the use of a larger matrix hides more frequency information.
Thus, a 3 ×3 Hill cipher hides not only single-letter but also two-letter frequency information.
Consider this example. Suppose that the plaintext “hillcipher” is encrypted using a Hill
cipher to yield the ciphertext HCRZSSXNSP. Thus, we know that (78) Kmod26=(72)11
11)Kmod26=(17 25); and so on. Using the first two plaintext–ciphertext pairs, we have
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:
Example
Alice wishes to send the message “HELLO” to Bob. If key material begins with “XMCKL” and the
message is “HELLO”, then use Vernam One Time Pad to Decrypt and Show the Encryption
Process.
MESSAGE H E L L O
POSITION 7 4 11 11 14
KEY X M C K L
POSITION 23 12 2 10 11
OTP Encryption
H E L L O Message
7 4 11 11 14 Message
(H) (E) (L) (L) (O)
23 12 2 10 11 Key
(X) (M) (C) (K) (L)
30 16 13 21 25 Message + Key
4 16 13 21 25 Message + Key (mod 26)
(E) (Q) (N) (V) (Z)
E Q N V Z Ciphertext
Note: If a number is larger than 25, then the remainder afer subtraction of 26 is taken in Modular
Arithmetic fashion
OTP Decryption
E Q N V Z Ciphertext
4 16 13 21 25 Ciphertext
(E) (Q) (N) (V) (Z)
23 12 2 10 11 Key
(X) (M) (C) (K) (L)
-19 4 11 11 14 Ciphertext - Key
7 4 11 11 14 Ciphertext - Key (mod 26)
(H) (E) (L) (L) (O)
H E L L O Message
Note: If a number is negative then 26 is added to make the number positive
Advantages
Encryption method is completely unbreakable for a cipher-text only known attack
Chosen Plaintext (or) Ciphertext attacks is not possible
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 second message.
6. Polyalphabetic Ciphers
VIGEN`ERE CIPHER The best known, and one of the simplest, polyalphabetic ciphers is the
Vigenère cipher. In this scheme, the set of related monoalphabetic substitution rules consists of
the 26 Caesar ciphers with shifts of 0 through 25. Each cipher is denoted by a key letter, which
is the ciphertext letter that substitutes for the plaintext letter a. Thus, a Caesar cipher with a shift
of 3 is denoted by the key value.
Express the Vigenère cipher in the following manner. Assume a sequence of plaintext
letters and a key consisting of the sequence of letters, where typically < .The sequence of
ciphertext letters is calculated as follows
Thus, the first letter of the key is added to the first letter of the plaintext, mod 26, the second
letters are added, and so on through the first letters of the plaintext. For the next letters of the
plaintext, the key letters are repeated. This process continues until all of the plaintext sequence
is encrypted. A general equation of the encryption process is
All the techniques examined so far involve the substitution of a ciphertext symbol for a
plaintext symbol. 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. 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:
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.A pure transposition
cipher is easily recognized because it has the same letter frequencies as the original plaintext.
For the type of columnar transposition just shown, cryptanalysis is fairly straightforward and
involves laying out the ciphertext in a matrix and playing around with column positions. Digram
and trigram frequency tables can be useful.
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
01 02 03 04 05 06 07 08 09 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27 28
After the first transposition, we have
03 10 17 24 04 11 18 25 02 09 16 23 01 08
15 22 05 12 19 26 06 13 20 27 07 14 21 28
MEMATRHTGPRYETEFETEOAAT
1.7 STEGANOGRAPHY
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
Steganography has a number of drawbacks when compared to encryption. It requires a lot of
overhead to hide a relatively few bits of information, although using a scheme like that proposed
in the preceding paragraph may make it more effective. Also, once the system is discovered, it
becomes virtually worthless. This problem, too, can be overcome if the insertion method
depends on some sort of key.
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.
Context of Cryptography
Cryptology, the study of cryptosystems, can be subdivided into two branches −
Cryptography
Cryptanalysis
Cryptography
Cryptography is the art and science of making a cryptosystem that is capable of
providing information security. Cryptography deals with the actual securing of digital data. It
refers to the design of mechanisms based on mathematical algorithms that provide fundamental
information security services.
Cryptanalysis
The art and science of breaking the cipher text is known as cryptanalysis. Cryptanalysis
is the sister branch of cryptography and they both co-exist. The cryptographic process results in
the cipher text for transmission or storage. It involves the study of cryptographic mechanism
with the intention to break them. Cryptanalysis is also used during the design of the new
cryptographic techniques to test their security strengths.
Note − Cryptography concerns with the design of cryptosystems, while cryptanalysis studies the
breaking of cryptosystems.
Encryption of information is done through public key first, with the help of a particular
algorithm. Then the private key, which the receiver possesses, will use to decrypt that encrypted
information. The same algorithm will be used in both encodings as well as decoding.
Perfect Secrecy (or information-theoretic secure) means that the ciphertext conveys no
information about the content of the plaintext. ... However, part of being provably secure is that
you need as much key material as you have plaintext to encrypt.
Its impact has been crucial to the success of the Voyager missions to deep space, the
invention of the compact disc, the feasibility of mobile phones, the development of the Internet,
the study of linguistics and of human perception, the understanding of black holes, and
numerous other fields. The field is at the intersection of mathematics, statistics, computer
science, physics, neurobiology, information engineering, and electrical engineering.
The theory has also found applications in other areas, including statistical
inference, natural language processing, cryptography, neurobiology, human vision, the
evolution and function of molecular codes (bioinformatics), model selection in statistics, thermal
physics, quantum computing, linguistics, plagiarism detection, pattern recognition, and anomaly
detection.
A product cipher combines two or more transformations in a manner intending that the
resulting cipher is more secure than the individual components to make it resistant
to cryptanalysis.
The combination could yield a cipher system more powerful than either one alone. This
approach of alternatively applying substitution and permutation transformation has been used
by IBM in the Lucifer cipher system, and has become the standard for national data encryption
standards such as the Data Encryption Standard and the Advanced Encryption Standard. A
product cipher that uses only substitutions and permutations is called a SP-network. Feistel
ciphers are an important class of product ciphers.
1.9 CRYPTANALYSIS
Cryptanalysis is the art of trying to decrypt the encrypted messages without the use of
the key that was used to encrypt the messages. Cryptanalysis uses mathematical analysis &
algorithms to decipher the ciphers.
Brute force attack– this type of attack uses algorithms that try to guess all the possible
logical combinations of the plaintext which are then ciphered and compared against the original
cipher.
Dictionary attack– this type of attack uses a wordlist in order to find a match of either
the plaintext or key. It is mostly used when trying to crack encrypted passwords.
Rainbow table attack– this type of attack compares the cipher text against pre-
computed hashes to find matches.
Man-in-the-Middle (MITM) Attack: Attack occurs when two parties use message or key
sharing for communication via a channel that appears secure but is actually
compromised. Attacker employs this attack for the interception of messages that pass
through the communications channel. Hash functions prevent MITM attacks.
Adaptive Chosen-Plaintext Attack (ACPA): Similar to a CPA, this attack uses chosen
plaintext and ciphertext based on data learned from past encryptions.