Computer Network and Information Security
Computer Network and Information Security
lOMoARcPSD|50362539
CNS –UNIT-I
Security Concepts: Introduction, The need for security, Security approaches, Principles of
security, Types of Security attacks, Security services, Security Mechanisms, A model for
Network Security
Cryptography Concepts and Techniques: Introduction, plain text and cipher text,
substitution techniques, transposition techniques, encryption and decryption, symmetric and
asymmetric key cryptography, steganography, key range and key size, possible types of
attacks.
1.1 INTRODUCTION
The protection afforded to an automated information system in order to attain the applicable
objectives of preserving the integrity, availability, and confidentiality of information system
resources (includes hardware, software, firmware, information/data, and
telecommunications).
The NIST Computer Security Handbook [NIST95] defines the term computer security as
follows:
Confidentiality: This term covers two related concepts:
Data confidentiality: Assures that private or confidential information is not made
available or disclosed to unauthorized individuals.
Privacy: Assures that individuals control or influence what information related to
them may be collected and stored and by whom and to whom that information
may be disclosed.
Integrity: This term covers two related concepts:
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 authorized
users.
Authenticity: The property of being genuine and being able to be verified and
trusted; confidence in the validity of a transmission, a message, or message originator.
This means verifying that users are who they say they are and that each input arriving
at the system came from a trusted source.
Accountability: The security goal that generates the requirement for actions of an
entity to be traced uniquely to that entity. This supports nonrepudiation, deterrence,
fault isolation, intrusion detection and prevention, and after action recovery and legal
action. Because truly secure systems are not yet an achievable goal, we must be able
to trace a security breach to a responsible party. Systems must keep records of their
activities to permit later forensic analysis to trace security breaches or to aid in
transaction disputes.
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.
Confidentiality:
The degree of confidentiality determines the secrecy of the information. The principle
specifies that only the sender and receiver will be able to access the information shared
between them. Confidentiality compromises if an unauthorized person is able to access a
message.
Authentication:
Authentication is the mechanism to identify the user or system or the entity. It ensures the
identity of the person trying to access the information. The authentication is mostly secured
by using username and password. The authorized person whose identity is preregistered can
prove his/her identity and can access the sensitive information.
Integrity:
Integrity gives the assurance that the information received is exact and accurate. If the
content of the message is changed after the sender sends it but before reaching the intended
receiver, then it is said that the integrity of the message is lost.
Non-Repudiation:
Non-repudiation is a mechanism that prevents the denial of the message content sent through
a network. In some cases the sender sends the message and later denies it. But the non-
repudiation does not allow the sender to refuse the receiver.
Access control:
The principle of access control is determined by role management and rule management.
Role management determines who should access the data while rule management determines
up to what extent one can access the data. The information displayed is dependent on the
person who is accessing it.
Availability:
The principle of availability states that the resources will be available to authorize party at all
times. Information will not be useful if it is not available to be accessed. Systems should have
sufficient availability of information to satisfy the user request.
lOMoARcPSD| 50362539
Passive Attacks
Passive attacks are in the nature of eavesdropping on, or monitoring of, transmissions. The
goal of the opponent is to obtain information that is being transmitted. Two types of passive
attacks are the release of message contents and traffic analysis.
A second type of passive attack, traffic analysis, is subtler. Suppose that we had a way of
masking the contents of messages or other information traffic so that opponents, even if they
captured the message, could not extract the information from the message. 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 sent and received in an apparently normal fashion, and
neither the sender nor receiver is aware that a third party has read the messages or observed
the traffic pattern.
Active Attacks
Active attacks (Figure 1.1b) involve some modification of the data stream or the creation of a
false stream and can be subdivided into four categories: masquerade, replay, modification of
messages, and denial of service. A masquerade takes place when one entity pretends to be a
different entity (path 2 of Figure 1.1b is active). 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 (paths 1, 2, and 3 active).
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 (paths 1 and 2
active). For example, a message meaning “Allow John Smith to read confidential file
accounts” is modified to mean “Allow Fred Brown to read confidential file accounts.”
The denial of service prevents or inhibits the normal use or management of communications
facilities (path 3 active). This attack may have a specific target; for example, an entity may
suppress all messages directed to a particular destination (e.g., the security audit service).
Another form of service denial is the disruption of an entire network, either by disabling the
network or by overloading it with messages so as to degrade performance.
Active attacks present the opposite characteristics of passive attacks. Whereas passive attacks
are difficult to detect, measures are available to prevent their success. On the other hand, it is
quite difficult to prevent active attacks absolutely
lOMoARcPSD| 50362539
Table 1.4, based on one in X.800, indicates the relationship between security services and
security mechanisms.
lOMoARcPSD| 50362539
A model for much of what we will be discussing is captured, in very general terms, in Figure
1.2. A message is to be transferred from one party to another across some sort of Internet
service. The two parties, who are the principals in this transaction, must cooperate for the
exchange to take place. A logical information channel is established by defining a route
through the Internet from source to destination and by the cooperative use of communication
protocols (e.g., TCP/IP) by the two principals.
Security aspects come into play when it is necessary or desirable to protect the information
transmission from an opponent who may present a threat to confidentiality, authenticity, and
so on. All the techniques for providing security have two components:
. 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 trusted third party may be needed to achieve secure transmission. For example, a third
party may be responsible for distributing the secret information to the two principals while
keeping it from any opponent. Or a third party may be needed to arbitrate disputes between
the two principals concerning the authenticity of a message transmission.
lOMoARcPSD| 50362539
This general model shows that there are four basic tasks in designing a particular security
service:
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.
lOMoARcPSD| 50362539
The security mechanisms needed to cope with unwanted access fall into two broad categories
(see Figure 1.3). The first category might be termed a gatekeeper function. It includes
password-based login procedures 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.
Introduction:
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.
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 ciphertext and the secret key and produces the original plaintext
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.
lOMoARcPSD| 50362539
We assume that it is impractical to decrypt a message on the basis of the ciphertext plus
knowledge of the encryption/decryption algorithm. In other words, we do not need to keep
the algorithm secret; we need to keep only the key secret. This feature of symmetric
encryption is what makes it feasible for widespread use. The fact that the algorithm need not
be kept secret means that manufacturers can and have developed low-cost chip
implementations of data encryption algorithms. These chips are widely available and
incorporated into a number of products. With the use of symmetric encryption, the principal
security problem is maintaining the secrecy of the key.
Let us take a closer look at the essential elements of a symmetric encryption scheme, using
Figure 2.2. A source produces a message in plaintext, X = [X1, X2, c, XM]. The M elements of
X are letters in some finite alphabet.
Traditionally, the alphabet usually consisted of the 26 capital letters. Nowadays, the binary
alphabet {0, 1} is typically used. For encryption, a key of the form K = [K1, K2, c, KJ] is
generated. If the key is generated at the message source, then it must also be provided to the
destination by means of some secure channel. 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, c, 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)
Cryptography
2. 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.
3. 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.
Cryptanalysis: Cryptanalytic attacks rely on the nature of the algorithm plus perhaps
some knowledge of the general characteristics of the plaintext or even some sample
plaintext–ciphertext pairs. 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 ciphertext
until an intelligible translation into plaintext is obtained. On average, half of all
possible keys must be tried to achieve success.
If either type of attack succeeds in deducing the key, the effect is catastrophic:
All future and past messages encrypted with that key are compromised. We first consider
cryptanalysis and then discuss brute-force attacks.
A brute-force attack involves trying every possible key until an intelligible translation of the
ciphertext into plaintext is obtained. On average, half of all possible keys must be tried to
achieve success. That is, if there are X different keys, on average an attacker would discover
the actual key after X>2 tries. It is important to note that there is more to a brute-force attack
than simply running through all possible keys
lOMoARcPSD| 50362539
Caesar Cipher
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
Then the algorithm can be expressed as follows. For each plaintext letter p, substitute the
ciphertext letter C:
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 k takes on a value in the range 1 to 25.
Monoalphabetic Ciphers
A dramatic increase in the key space can be achieved by allowing an arbitrary substitution.
Before proceeding, we define the term permutation. A permutation of a finite set of elements
lOMoARcPSD| 50362539
S is an ordered sequence of all the elements of S, with each element appearing exactly once.
For example, if S = {a, b, c}, there are six permutations of S:
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: z y xw v u t s r q po n m l k j i h g f e d c b a
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.
Example:
Let's take our keyword as 'INCLUDE HELP IS AWESOME'. Then 5 x 5 matrix will look
as:
Step 2: Encryption
This process consist of the following process:
1. The plain-text we want to encrypt need to broke down into a pair of alphabets. For
example, if our message is "MY NAME IS POGO", it will become "MY NA ME
IS PO GO".
2. If both alphabets are the same (or only left), add an X after the first alphabet in a pair.
Encrypt the new pair (after adding X) then continue.
a. If pair appears in the same row of the matrix, replace them with a letter at its
right, if it's at the right end of the row then wrapping around the left side of the
row.
3. If pair appears in the same column of the matrix, replace them with the alphabet
below them. If it's on the bottom then wrapping around the top of the row.
lOMoARcPSD| 50362539
4. If the pairis not in the same row or column, replace them with the alphabets in the
same row respectively, but at the other pair of cornersof the rectangle defined by the
original pair. The order is quite significant here. The first encrypt alphabet of the pair
is the one that is present on the same row as the first plaintext alphabet.
Explanation:
"MY NA ME IS PO GO"
So we start with MY now in the above matrix it was not in the same row or column then rule
5 will apply.
Hill Cipher
The Hill cipher is based on polygraphic substitution that is it works on multiple letters at the
same time, introduced by Lester Hill in 1929. This method related to the matrix theory of
mathematics, specifically how to compute the inverse of a matrix.
3. Now, we multiply our matrix with randomly chosen keys. The size of the key must
be n x n where n is a number of rows of our plain-text matrix.
Forexample:
5. Now we will calculate a mod 26 value of the above matrix, that is remainder after
dividing 26.
6. Translate back number to alphabets, 5=F, 8=I, 13=N. Therefore, our cipher-text
is "FIN".
7. For Decryption, take the cipher-text matrix and multiply it with the inverse of our
original key matrix:
Vernam Cipher
Vernam Cipher The ultimate defense against such a cryptanalysis is to choose a keyword
that is as long as the plaintext and has no statistical relationship to it. Such a system was
introduced by an AT&T engineer named Gilbert Vernam in 1918.
His system works on binary data (bits) rather than letters. The system can be expressed
succinctly as follows (Figure 2.7):
lOMoARcPSD| 50362539
ci = pi ⊕ ki
Where
pi = ith binary digit of plaintext
ki = ith binary digit of key
ci = ith binary digit of ciphertext
⊕ = exclusive-or (XOR) operation
Thus, the ciphertext is generated by performing the bitwise XOR of the plaintext and the key.
Because of the properties of the XOR, decryption simply involves the same bitwise
operation:
pi = ci ⊕ ki
One-Time Pad
It produces random output that bears no statistical relationship to the plaintext. Because the
ciphertext contains no information whatsoever about the plaintext, there is simply no way to
break the code
Algorithm:
1. Plain text character will be represented by the numbers as A=0, B=1, C=2,... Z=25.
2. Add each corresponding number of a plain text message to the input cipher text
alphabet numbers.
3. If the sum is greater than or equal to 26, subtract 26 from it.
4. Translate each number back to corresponding letters and we got our cipher text.
Example:
Our message is "INCLUDEHELP" and input cipher text is "ATQXRZWOBYV"
lOMoARcPSD| 50362539
Now let’s decide on an order for the column as 4, 1, 3 and 2 and now we will read the text in
column-wise.
Cipher-text: LHIEEIUESSCEPWMNDLAO
The major distinction between secret writing associated secret writing is that secret writing is
that the conversion of a message into an unintelligible kind that’s undecipherable unless
decrypted. whereas secret writing is that the recovery of the first message from the encrypted
information.
with either secret key or public decrypted with either secret key or private
key. key.
5. In encryption process, sender Whereas in decryption process, receiver
sends the data to receiver after receives the information(Cipher text) and
encrypted it. convert into plain text.
Advantages
A symmetric cryptosystem is more effective.
9
Encrypted data can be transmitted over a network in Symmetric Cryptosystems even
though it is certain that the data would be intercepted. Since no key is sent with the
files, the chances of data decryption are zero.
To confirm the receiver’s existence, a symmetric cryptosystem employs password
authentication.
A message can only be decrypted by a device that has a hidden key.
Prevents widespread message protection breaches. For communicating with each
party, a separate secret key is used. Only communications from a specific pair of
sender and recipient are impacted when a key is corrupted. Communication with
others is always safe.
This type of encryption is simple to implement. All users need to do is specify and
exchange the secret key until they can begin encrypting and decrypting messages.
Encrypt and decrypt your files. There is no need to build separate keys if you use
encryption for messages or data that you wish to access just once. For this, single-key
encryption is ideal.
Symmetric key encryption is much faster than asymmetric key encryption.
Uses fewer computer resources. As opposed to public-key encryption, single-key
encryption needs fewer computing resources.
Disadvantages
Key transportation is a concern in symmetric cryptosystems. The secret key must be
sent to the receiving device before the final message is sent. Electronic
communication is unreliable, and no one can guarantee the communication networks
will not be tapped. As a result, the only safe method of sharing keys will be to do it in
person.
It is not possible to have digital signatures that cannot be revoked.
The message’s origin and validity cannot be assured. Messages cannot be proven to
have originated from a specific person since both sender and recipient use the same
key. If there is a disagreement, this may be a challenge.
For communication between each different party, a new shared key must be created.
This poses a challenge with handling and securing both of these key
The main benefit of public-key cryptography is improved security: private keys are
never exchanged or exposed to others.
May provide digital signatures that can be revoked.
Message verification is provided by public-key cryptography, which requires the use
of digital signatures, which allows the receiver of a message to check that the message
is actually from a specific sender.
The usage of digital signatures in public-key cryptography helps the recipient to
determine whether or not the message was altered during transit. A digitally signed
message cannot be altered without rendering the signature null.
Signing a message digitally is analogous to physically signing a document. Since it is
an acknowledgement of the message, the sender cannot reject it.
Disadvantages
One drawback of using public-key cryptography for encryption is the lack of speed.
Popular secret-key encryption systems are substantially quicker than any commonly
accessible public-key encryption technique.
Authentication of public keys is recommended/required. No one can be certain that a
public key corresponds to the individual it identifies, so everybody must verify that
their public keys are theirs.
It consumes more computer resources. It necessitates much more computing resources
than single-key encryption.
A widespread security breach is likely if an intruder obtains a person’s private key and
reads his or her entire message.
The loss of a private key can be irreversible. When a private key is lost, all incoming
messages cannot be decrypted.
While asymmetric cryptography is more advanced than symmetric cryptography, both are
still in use today — and are often used in tandem. This is because each solution has its
advantages and disadvantages. There are two significant trade-offs between symmetric and
asymmetric cryptography: speed and security.
Since it does not include the exchange of keys, asymmetric encryption is thought to be more
reliable. A user’s private key is never revealed or shared. Symmetric encryption takes longer
than symmetric encryption and is generally a slower process. However, this is not a
significant disadvantage, and it is commonly used to encrypt data where confidentiality is the
primary concern.
STEGANOGRAPH
The word Steganography is derived from two Greek words- ‘stegos’ meaning ‘to cover’ and
‘grayfia’, meaning ‘writing’, thus translating to ‘covered writing’, or ‘hidden
writing’. Steganography is a method of hiding secret data, by embedding it into an audio,
lOMoARcPSD| 50362539
video, image, or text file. It is one of the methods employed to protect secret or sensitive data
from malicious attacks.
Ciphertext Only Attacks (COA) − In this method, the attacker has access to a set of
ciphertext(s). He does not have access to corresponding plaintext. COA is said to be
successful when the corresponding plaintext can be determined from a given set of
ciphertext. Occasionally, the encryption key can be determined from this attack.
Modern cryptosystems are guarded against ciphertext-only attacks.
Known Plaintext Attack (KPA) − In this method, the attacker knows the plaintext
for some parts of the ciphertext. The task is to decrypt the rest of the ciphertext using
this information. This may be done by determining the key or via some other method.
The best example of this attack is linear cryptanalysis against block ciphers.
Chosen Plaintext Attack (CPA) − In this method, the attacker has the text of his
choice encrypted. So he has the ciphertext-plaintext pair of his choice. This simplifies
his task of determining the encryption key. An example of this attack is differential
cryptanalysis applied against block ciphers as well as hash functions. A popular public
key cryptosystem, RSA is also vulnerable to chosen-plaintext attacks.
Dictionary Attack − This attack has many variants, all of which involve compiling a
‘dictionary’. In simplest method of this attack, attacker builds a dictionary of
ciphertexts and corresponding plaintexts that he has learnt over a period of time. In
future, when an attacker gets the ciphertext, he refers the dictionary to find the
corresponding plaintext.
Brute Force Attack (BFA) − In this method, the attacker tries to determine the key
by attempting all possible keys. If the key is 8 bits long, then the number of possible
keys is 28 = 256. The attacker knows the ciphertext and the algorithm, now he
attempts all the 256 keys one by one for decryption. The time to complete the attack
would be very high if the key is long.
lOMoARcPSD| 50362539
Similarly, if the hash function produces 64 bit hash values, the possible hash values are
1.8x1019. By repeatedly evaluating the function for different inputs, the same output is
expected to be obtained after about 5.1x109 random inputs.
If the attacker is able to find two different inputs that give the same hash value, it is
a collision and that hash function is said to be broken.
Man in Middle Attack (MIM) − The targets of this attack are mostly public key
cryptosystems where key exchange is involved before communication takes place.
o An attacker intercepts this request and sends his public key instead.
o The attacker sends his public key as A’s public key so that B takes it as if it is
taking it from A.
Side Channel Attack (SCA) − This type of attack is not against any particular type of
cryptosystem or algorithm. Instead, it is launched to exploit the weakness in physical
implementation of the cryptosystem.
Timing Attacks − They exploit the fact that different computations take different
times to compute on processor. By measuring such timings, it is be possible to know
about a particular computation the processor is carrying out. For example, if the
encryption takes a longer time, it indicates that the secret key is long.
Power Analysis Attacks − These attacks are similar to timing attacks except that the
amount of power consumption is used to obtain information about the nature of the
underlying computations.
Fault analysis Attacks − In these attacks, errors are induced in the cryptosystem and
the attacker studies the resulting output for useful information.