NSC Notes
NSC Notes
INTRODUCTION
CRYPTOLOGY:
cryptology, science concerned with data communication and storage in secure and usually
secret form. In other words, this is the study of techniques for ensuring security and
authenticity of information. It encompasses both cryptography and cryptanalysis (main
branches).
CRYPTOGRAPHY:
Cryptography is technique of securing information and communications through use of
codes so that only those person for whom the information is intended can understand it
and process it. Thus preventing unauthorized access to information. The prefix “crypt”
means “hidden” and suffix graphy means “writing”.
CRYPT ANALYSIS:
Cryptanalysis which is the study of the cryptographic algorithm and the breaking of those
secret codes. The person practicing Cryptanalysis is called a Cryptanalyst. It helps us to
better understand the cryptosystems and also helps us improve the system by finding any
weak point and thus work on the algorithm to create a more secure secret code. For
example, a Cryptanalyst might try to decipher a ciphertext to derive the plaintext. It can
help us to deduce the plaintext or the encryption key.
NETWORK SECURITY:
Network Security refers to the measures taken by any enterprise or organization to
secure its computer network and data using both hardware and software systems. This
aims at securing the confidentiality and accessibility of the data and network. Every
company or organization that handles a large amount of data, has a degree of solutions
against many cyber threats.
The most basic example of Network Security is password protection which the user of the
network oneself chooses.
Passive attack
Traffic analysis –
Suppose that we had a way of masking (encryption) information, so that the attacker even if
captured the message could not extract any information from the message.
Traffic analysis
The opponent could determine the location and identity of communicating host 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.
The most useful protection against traffic analysis is encryption of SIP traffic. To do this, an
attacker would have to access the SIP proxy (or its call log) to determine who made the call.
Active attacks: An Active attack attempts to alter system resources or affect their
operations. Active attacks involve some modification of the data stream or the creation of
false statements. Types of active attacks are as follows:
• Masquerade
• Modification of messages
• Repudiation
• Replay
• Denial of Service
Masquerade –
A masquerade attack takes place when one entity pretends to be a different entity. A
Masquerade attack involves one of the other forms of active attacks. If an authorization
procedure isn’t always absolutely protected, it is able to grow to be extraordinarily liable to
a masquerade assault. Masquerade assaults may be performed using the stolen passwords
and logins, with the aid of using finding gaps in programs, or with the aid of using locating a
manner across the authentication process.
Masquerade Attack
Modification of messages –
Modification of messages
It means that some portion of a message is altered or that message is delayed or reordered
to produce an unauthorized effect. Modification is an attack on the integrity of the original
data. It basically means that unauthorized parties not only gain access to data but also spoof
the data by triggering denial-of-service attacks, such as altering transmitted data packets or
flooding the network with fake data. Manufacturing is an attack on authentication. For
example, a message meaning “Allow JOHN to read confidential file X” is modified as “Allow
Smith to read confidential file X”.
Replay –
It involves the passive capture of a message and its subsequent transmission to produce an
authorized effect. In this attack, the basic aim of the attacker is to save a copy of the data
originally present on that particular network and later on use this data for personal uses.
Once the data is corrupted or leaked it is insecure and unsafe for the users.
Replay
Denial of Service –
It prevents the normal use of communication facilities. This attack may have a specific target.
For example, an entity may suppress all messages directed to a particular destination.
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.
Denial of Service
SECURITY MECHANISMS:
• specific security mechanisms
• Pervasive security mechanisms
SECURITY SERVICES:
There are various security services which are as follows −
Message Confidentiality − The principle of confidentiality defines that only the sender and
the intended recipient should be capable to create the element of the message. It protects the
transmitted data from passive attack.
Confidentiality can be used at several levels on the basis of content of an information to be
transmitted. There are the following types of confidentiality which are as follows −
o Connection Confidentiality − The protection of all user
information on a connection.
o Connectionless Confidentiality − The security of all user data
in an individual data block.
o Selective field Confidentiality – It is within the user data on a
connection or in a single data block.
o Traffic-flow Confidentiality − The protection of the information
that can be derived from observation of traffic flows.
Authentication − The authentication service is concerned with likely that a connection is
authentic. In the case of a single message, including a warning or alarm signal, the function
of the authentication service is to persuade the recipient that the message is from the source
that it declare to be from.
In the case of an ongoing interaction, such as the connection of a terminal to a host, two
aspects are involved. First, at the time of connection initiation, the service assures that the
two entities are authentic, that is, that each is the entity that it claims to be. Second, the
service must assure that the connection is not interfered with in such a way that a third party
can masquerade as one of the two legitimate parties for the purposes of unauthorized
transmission or reception.
• Peer entity authentication: Provides for the corroboration of the identity of a peer
entity in an association. Two entities are considered peers if they implement to same
protocol in different systems; e.g., two TCP mod-ules in two communicating systems. Peer
entity authentication is provided for use at the establishment of, or at times during the data
transfer phase of, a connection. It attempts to provide confidence that an entity is not
performing either a masquerade or an unauthorized replay of a previous connection.
• Data origin authentication: Provides for the corroboration of the source of a data unit.
It does not provide protection against the duplication or modification of data units. This type
of service supports applications like electronic mail, where there are no prior interactions
between the commu-nicating entities.
Data Integrity − Data integrity is designed to secure information from modification, insertion,
deletion and rehashing by any entity. Data integrity can be used to a flow of message, an
individual message or a selected portion inside a message. Data integrity can be used to
support total stream protection.
There are various types of data integrity which are as follows −
o Connection integrity with recovery − It supports for the
integrity of all user information on a connection and identify any
modification, insertion, deletion or replay of any information
within a whole data sequence, with recovery attempted.
o Connection integrity without recovery − It supports only detection
without recovery.
o Selective-field connection integrity − It supports for the
principle of selected areas within the user information of a data
block shared over a connection and creates the form of decision
of whether the selected fields have been changed, inserted,
removed or replayed.
o Connectionless integrity − It supports for the integrity of an
individual connectionless data block and can take the form of
detection of data modification. Moreover, it is a limited form of
replay detection can be provided.
o Selective-field connectionless integrity − It supports for the
integrity of selected fields within an individual connectionless
data block and takes the form of determination of whether the
selected areas have been changed.
A Network Security Model exhibits how the security service has been designed over the
network to prevent the opponent from causing a threat to the confidentiality or authenticity of
the information that is being transmitted through the network.
In this section, we will be discussing the general ‘network security model’ where we will
study how messages are shared between the sender and receiver securely over the
network. And we will also discuss the ‘network access security model’ which is designed
to secure your system from unwanted access through the network
For a message to be sent or receive there must be a sender and a receiver. Both the sender
and receiver must also be mutually agreeing to the sharing of the message. Now, the
transmission of a message from sender to receiver needs a medium i.e. Information
channel which is an Internet service.
A logical route is defined through the network (Internet), from sender to the receiver and
using the communication protocols both the sender and the receiver established
communication.
Well, we are concerned about the security of the message over the network when the
message has some confidential or authentic information which has a threat from an
opponent present at the information channel. Any security service would have the three
components discussed below:
1. Transformation of the information which has to be sent to the receiver. So, that any
opponent present at the information channel is unable to read the message. This indicates
the encryption of the message. It also includes the addition of code during the
transformation of the information which will be used in verifying the identity of the authentic
receiver.
2. Sharing of the secret information between sender and receiver of which the opponent
must not any clue. Yes, we are talking of the encryption key which is used during the
encryption of the message at the sender’s end and also during the decryption of message at
receiver’s end.
3. There must be a trusted third party which should take the responsibility of distributing
the secret information (key) to both the communicating parties and also prevent it from any
opponent.
Now we will study a general network security model with the help of the figure given below:
Secret information is used while transforming the message which will also be required
when the message will be retransformed at the recipient side. That’s why a trusted third
party is required which would take the responsibility of distributing this secret information to
both the parties involved in communication.
So, considering this general model of network security, one must consider the following four
tasks while designing the security model.
2. Next, the network security model designer is concerned about the generation of the
secret information which is known as a key.
This secret information is used in conjunction with the security algorithm in order to
transform the message.
3. Now, the secret information is required at both the ends, sender’s end and receiver’s end.
At sender’s end, it is used to encrypt or transform the message into unreadable form and at
the receiver’s end, it is used to decrypt or retransform the message into readable form.
So, there must be a trusted third party which will distribute the secret information to both
sender and receiver. While designing the network security model designer must also
concentrate on developing the methods to distribute the key to the sender and receiver.
An appropriate methodology must be used to deliver the secret information to the
communicating parties without the interference of the opponent.
It is also taken care that the communication protocols that are used by the communicating
parties should be supporting the security algorithm and the secret key in order to achieve the
security service.
Till now we have discussed the security of the information or message over the network.
Now, we will discuss the network access security model which is designed to secure the
information system which can be accessed by the attacker through the network.
You are well aware of the attackers who attack your system that is accessible through the
internet. These attackers fall into two categories:
1. Hacker: The one who is only interested in penetrating into your system. They do not
cause any harm to your system they only get satisfied by getting access to your system.
2. Intruders: These attackers intend to do damage to your system or try to obtain the
information from the system which can be used to attain financial gain.
The attacker can place a logical program on your system through the network which can
affect the software on your system. This leads to two kinds of risks:
a. Information threat: This kind of threats modifies data on the user’s behalf to which
actually user should not access. Like enabling some crucial permission in the system.
b. Service threat: This kind of threat disables the user from accessing data on the system.
2. CLASSICAL ENCRYPTION TECHNIQUES
1. Plain Text (x): This is the original data/message that is to be communicated to the
receiver by the sender. It is one of the inputs to the encryption algorithm.
2. Secret Key (k): It is a value/string/textfile used by the encryption and decryption algorithm
to encode and decode the plain text to cipher text and vice-versa respectively. It is
independent of the encryption algorithm. It governs all the conversions in plain text. All the
substitutions and transformations done depend on the secret key.
3. Encryption Algorithm (E): It takes the plain text and the secret key as inputs and
produces Cipher Text as output. It implies several techniques such as substitutions and
transformations on the plain text using the secret key.
E(x, k) = y
4. Cipher Text (y): It is the formatted form of the plain text (x) which is unreadable for
humans, hence providing encryption during the transmission. It is completely dependent
upon the secret key provided to the encryption algorithm. Each unique secret key produces
a unique cipher text.
5. Decryption Algorithm (D): It performs reversal of the encryption algorithm at the
recipient’s side. It also takes the secret key as input and decodes the cipher text received
from the sender based on the secret key. It produces plain text as output.
D(y, k) = x
There are only two requirements that need to be met to perform encryption. They are,
1. Encryption Algorithm: There is a need for a very strong encryption algorithm that
produces cipher texts in such a way that the attacker should be unable to crack the secret
key even if they have access to one or more cipher texts.
2. Secure way to share Secret Key: There must be a secure and robust way to share the
secret key between the sender and the receiver. It should be leakproof so that the attacker
cannot access the secret key.
Cryptography
Cryptographic systems are characterized along three independent dimensions:
1. The type of operations used for transforming plaintext to ciphertext. All encryption
algorithms are based on two general principles: substitution, in which each element in the
plaintext (bit, letter, group of bits or letters) is mapped into another element, and transposition,
in which elements in the plaintext are rearranged. The fundamental requirement is that no
informa-tion be lost (that is, that all operations are reversible). Most systems, referred to
as product systems, involve multiple stages of substitutions and transpositions.
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 encryp-tion. 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.
A brute force attack is a hacking method that uses trial and error to crack passwords, login
credentials, and encryption keys. It is a simple yet reliable tactic for gaining unauthorized
access to individual accounts and organizations’ systems and networks. The hacker tries
multiple usernames and passwords, often using a computer to test a wide range of
combinations, until they find the correct login information.
The name "brute force" comes from attackers using excessively forceful attempts to gain
access to user accounts. Despite being an old cyberattack method, brute force attacks are
tried and tested and remain a popular tactic with hackers.
Types of Brute Force Attacks
There are various types of brute force attack methods that allow attackers to gain
unauthorized access and steal user data.
1. Simple Brute Force Attacks
A simple brute force attack occurs when a hacker attempts to guess a user’s login
credentials manually without using any software. This is typically through standard password
combinations or personal identification number (PIN) codes.
These attacks are simple because many people still use weak passwords, such as
"password123" or "1234," or practice poor password etiquette, such as using the same
password for multiple websites. Passwords can also be guessed by hackers that do minimal
reconnaissance work to crack an individual's potential password, such as the name of their
favorite sports team.
2. Dictionary Attacks
A dictionary attack is a basic form of brute force hacking in which the attacker selects a
target, then tests possible passwords against that individual’s username. The attack method
itself is not technically considered a brute force attack, but it can play an important role in a
bad actor’s password-cracking process.
The name "dictionary attack" comes from hackers running through dictionaries and
amending words with special characters and numbers. This type of attack is typically time-
consuming and has a low chance of success compared to newer, more effective attack
methods.
3. Hybrid Brute Force Attacks
A hybrid brute force attack is when a hacker combines a dictionary attack method with a
simple brute force attack. It begins with the hacker knowing a username, then carrying out a
dictionary attack and simple brute force methods to discover an account login combination.
The attacker starts with a list of potential words, then experiments with character, letter, and
number combinations to find the correct password. This approach allows hackers to discover
passwords that combine common or popular words with numbers, years, or random
characters, such as "SanDiego123" or "Rover2020."
4. Reverse Brute Force Attacks
A reverse brute force attack sees an attacker begin the process with a known password,
which is typically discovered through a network breach. They use that password to search
for a matching login credential using lists of millions of usernames. Attackers may also use a
commonly used weak password, such as "Password123," to search through a database of
usernames for a match.
5. Credential Stuffing
Credential stuffing preys on users’ weak password etiquettes. Attackers collect username
and password combinations they have stolen, which they then test on other websites to see
if they can gain access to additional user accounts. This approach is successful if people
use the same username and password combination or reuse passwords for various
accounts and social media profiles.
Q3: Substitution Methods:
The two basic building blocks of all encryption techniques are substitution and transposition.
Substitution technique is a classical encryption approach where the characters present in the
initial message are restored by the other characters or numbers or by symbols. If the plain
text (original message) is treated as the string of bits, thus the substitution technique would
restore bit pattern of plain text with the bit pattern of cipher text.
There are various types of substitution ciphers which are as follows –
• Caesar Cipher
• Monoalphabetic Ciphers
• Playfair Cipher
• Hill Cipher
• Polyalphabetic Ciphers
Caesar Cipher or Shift Cipher:
The Caesar cipher is the simplest and oldest method of cryptography. The Caesar cipher
method is based on a mono-alphabetic cipher and is also called a shift cipher or additive
cipher. Julius Caesar used the shift cipher (additive cipher) technique to communicate with his
officers. For this reason, the shift cipher technique is called the Caesar cipher. The Caesar
cipher is a kind of replacement (substitution) cipher, where all letter of plain text is replaced by
another letter.
Let's take an example to understand the Caesar cipher, suppose we are shifting with 1, then
A will be replaced by B, B will be replaced by C, C will be replaced by D, D will be replaced by
C, and this process continues until the entire plain text is finished.
Caesar ciphers is a weak method of cryptography. It can be easily hacked. It means the
message encrypted by this method can be easily decrypted.
If any case (Dn) value becomes negative (-ve), in this case, we will add 26 in the negative
value. Where,
E denotes the encryption
D denotes the decryption
x denotes the letters value
n denotes the key value (shift value)
Example: 2 Use the Caesar cipher to encrypt and decrypt the message "HELLO," and the
key (shift) value of this message is 15.
Encryption
En (x) = (x + n) mod 26
Note that the Caesar cipher is monoalphabetic, so the same plaintext letters are encrypted as
the same letters. Like, "HELLO" has "L", encrypted by "A".
Decryption
Note: If any case (Dn) value becomes negative (-ve), in this case, we will add 26 in the negative
value. Like, the third letter of the ciphertext.
Dn = (00-15) mod 26 = -15
The value of dn is negative, so 26 will be added to it.
= -15+26 = 11
Monoalphabetic Ciphers:
A monoalphabetic cipher is any cipher in which the letters of the plain text are mapped to
cipher text letters based on a single alphabetic key. Examples of monoalphabetic ciphers
would include the Caesar-shift cipher, where each letter is shifted based on a numeric key,
and the atbash cipher, where each letter is mapped to the letter symmetric to it about the
center of the alphabet.
There are various techniques of Monoalphabetic cipher which are as follows – (**Refer Notes)
• Additive Cipher
• Multiplicative Cipher
• Affine Cipher
Playfair Cipher:
The Playfair cipher was the first practical digraph substitution cipher. In playfair cipher
unlike traditional cipher we encrypt a pair of alphabets(digraphs) instead of a single
alphabet.
It was used for tactical purposes by British forces in the Second Boer War and in World War
I and for the same purpose by the Australians during World War II. This was because
Playfair is reasonably fast to use and requires no special equipment.
The Playfair Cipher Encryption Algorithm:
The Algorithm consists of 2 steps:
• The initial alphabets in the key square are the unique alphabets of
the key in the order in which they appear followed by the remaining
letters of the alphabet in order.
2. Algorithm to encrypt the plain text: The plaintext is split into pairs of two
letters (digraphs). If there is an odd number of letters, a Z is added to the last
letter.
For example:
PlainText: "instruments" After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz'
Hill Cipher:
Hill cipher is a polygraphic substitution cipher based on linear algebra.Each letter is
represented by a number modulo 26. Often the simple scheme A = 0, B = 1, …, Z = 25 is
used, but this is not an essential feature of the cipher. To encrypt a message, each block of
n letters (considered as an n-component vector) is multiplied by an invertible n × n matrix,
against modulus 26. To decrypt the message, each block is multiplied by the inverse of the
matrix used for encryption.
The matrix used for encryption is the cipher key, and it should be chosen randomly from the
set of invertible n × n matrices (modulo 26).
(*** refer NESO Academy for Ex.)
Polyalphabetic Ciphers:
• Vigenere cipher:
Formula of encryption is,
Ei = (Pi + Ki) mod 26
Formula of decryption is,
Di = (Ei - Ki) mod 26
If any case (Di) value becomes negative (-ve), in this case, we will add 26 in the
negative value.
Where,
E denotes the encryption.
D denotes the decryption.
P denotes the plaintext.
K denotes the key.
Plaintext J A V A T P O I N T
Key B E S T B E S T B E
Ciphertext K E N T U T G B O X
If any case (Di) value becomes negative (-ve), in this case, we will add 26 in the
negative value. Like, the third letter of the ciphertext;
N = 13 and S = 18
Ciphertext K E N T U T G B O X
Key B E S T B E S T B E
Plaintext J A V A T P O I N T
Q4: Transposition Techniques:
In cryptography, a transposition cipher is a method of encryption by which the positions held
by units of plaintext (which are commonly characters or groups of characters) are shifted
according to a regular system, so that the ciphertext constitutes a permutation of the
plaintext. That is, the order of the units is changed. Mathematically a bijective function is
used on the characters' positions to encrypt and an inverse function to decrypt.
Those are 2 techniques:
1. Reil Fence Cipher
2. Route Cipher
1. Reil Fence Cipher:
The Rail Fence cipher is a form of transposition cipher that gets its name from the way in
which it is encoded. In the rail fence cipher, the plaintext is written downwards on successive
"rails" of an imaginary fence, then moving up when we get to the bottom. The message is
then read off in rows. For example, using three "rails" and a message of “meet me after the
toga party” with a rail fence of
depth 2, we write the following:
WRIORFEOE
EESVELANJ
ADCEDETCX
The key might specify "spiral inwards, clockwise, starting from the top right". That
would give a cipher text of:
EJXCTEDECDAEWRIORFEONALEVSE
Ex 2:
This sort of thing would be trivial to cryptanalyze. A more complex scheme is
to write the message in a rectangle, row by row, and read the message off, column by
column, but permute the order of the columns. The order of the columns then
becomes the key to the algorithm. For example,
Ciphertext:
TTNAAPTMTSUOAODWCOIXKNLYPETZ
The letter in the first position of the block (on the left) moves to position 3, the letter in
position 2 moves to position 5, the letter in position 3 moves to position 4, the letter in
position 4 moves to position 1, and the letter in position 5 moves to position 2.
After the permutation is applied to the first block, we have:
When the permutation is applied to all the blocks, we obtain:
monoa lphab eticu nilat erals ubsti tutio nsyst emxxx
oamno ablhp cueit atnli lsear tiusb onttu stnys xxexm
So, the ciphertext message is
oamnoablhpcueitatnlilseartiusbonttustnysxxexm
If desired, the ciphertext can be divided into blocks for transmission. Here is a ciphertext
message enciphered using the 5-letter permutation give above.
THNROKEENRCKNUTIVYNUITESRXXYXX
The message is deciphered by applying the inverse of the permutation: The letter in the first
position of the block (on the left) moves to position 4, the letter in position 2 moves to
position 5, the letter in position 3 moves to position 1, the letter in position 4 moves to
position 3, and the letter in position 5 moves to position 2.
THNROKEENRCKNUTIVYNUITESRXXYXX
THNRO KEENR CKNUT IVYNU ITESR XXYXX
north ernke ntuck yuniv ersit yxxxx
3. MODERN ENCRYPTION TECHNIQUES
The function fk takes as input not only the data passing through the encryption
algorithm, but also an 8-bit key. Here a 10-bit key is used from which two 8-bit subkeys
are generated. The key is first subjected to a permutation (P10). Then a shift operation
is performed. The output of the shift operation then passes through a permutation
function that produces an 8-bit output (P8) for the first subkey (K1). The output of the
shift operation also feeds into another shift and another instance of P8 to produce the
second subkey (K2).
Where
S-DES depends on the use of a 10-bit key shared between sender and receiver. From this
key, two 8-bit subkeys are produced for use in particular stages of the encryption and
decryption algorithm. First, permute the key in the following fashion. Let the 10-bit key be
designated as (k1, K2, k3, k4, k5, k6, k7, k8, k9, k10). Then the permutation P10 is defined
as:
P10 (k1, K2, k3, k4, k5, k6, k7, k8, k9, k10) = (k3, k5, K2, k7, k4, k10 10, k1, k9, k8, k6) P10
can be concisely defined by the display:
This table is read from left to right; each position in the table gives the identity of the input bit
that produces the output bit in that position. So the first output bit is bit 3 of the input; the
second output bit is bit 5 of the input, and so on. For example, the key (1010000010) is
permuted to (10000 01100). Next, perform a circular left shift (LS-1), or rotation, separately on
the first five bits and the second five bits. In our example, the result is (00001 11000). Next we
apply P8, which picks out and permutes 8 of the 10 bits according to the following rule:
The result is subkey 1 (K1). In our example, this yields (10100100). We then go back
to the pair of 5-bit strings produced by the two LS-1 functions and performs a circular
left shift of 2 bit positions on each string. In our example, the value (00001 11000)
becomes (00100 00011). Finally, P8 is applied again to produce K2. In our example,
the result is (01000011).
2 S-DES encryption
The input to the algorithm is an 8-bit block of plaintext, which we first permute using the IP
function:
This retains all 8 bits of the plaintext but mixes them up.
Consider the plaintext to be 11110011.
The Function fk
The most complex component of S-DES is the function fk, which consists of a combination of
permutation and substitution functions. The functions can be expressed as follows. Let L and
R be the leftmost 4 bits and rightmost 4 bits of the 8-bit input to f K, and let F be a mapping
(not necessarily one to one) from 4-bit strings to 4-bit strings. Then we let
We now describe the mapping F. The input is a 4-bit number (n1 n2 n3 n4). The first operation
is an expansion/permutation operation:
e.g., R= 1101
The 8-bit subkey K1 = (k11, k12 12, k13 13, k14 14, k15 15, k16 16, k17 17, k18) is added to
this value using exclusive-OR:
The first 4 bits (first row of the preceding matrix) are fed into the S-box S0 to produce
a 2- bit output, and the remaining 4 bits (second row) are fed into S1 to produce another
2-bit output.
The S-boxes operate as follows. The first and fourth input bits are treated as a 2-bit number
that specify a row of the S-box, and the second and third input bits specify a column of the S-
box. The entry in that row and column, in base 2, is the 2-bit output. For example, if (p0,0 p0,3)
= ) (00) and ( p0,1 p0,2) = (10), then the output is from row 0, column 2 of S0, which is 3, or
(11) in ) binary. Similarly, (p1,0 p1,3) and ( p1,1 p1,2) are used to index into a row and column
of S1 to produce an additional 2 bits. Next, the 4 bits produced by S0 and S1 undergo a further
permutation as follows:
The function f K only alters the leftmost 4 bits of the input. The switch function (SW)
interchanges the left and right 4 bits so that the second instance of f K operates on a different
4 bits. In this second instance, the E/P, S0, S1, and P4 functions are the same. The key input
is K2. Finally apply inverse permutation to get the ciphertext.
Q2: DATA ENCRYPTION STANDARD (DES)
The Data Encryption Standard (DES) is a symmetric-key block cipher published by the
National Institute of Standards and Technology (NIST).
DES is an implementation of a Feistel Cipher. It uses 16 round Feistel structure. The block
size is 64-bit. Though, key length is 64-bit, DES has an effective key length of 56 bits, since 8
of the 64 bits of the key are not used by the encryption algorithm (function as check bits only).
General Structure of DES is depicted in the following illustration −
Since DES is based on the Feistel Cipher, all that is required to specify DES is −
• Round function
• Key schedule
• Any additional processing − Initial and final permutation
Initial and Final Permutation
The initial and final permutations are straight Permutation boxes (P-boxes) that are inverses
of each other. They have no cryptography significance in DES. The initial and final
permutations are shown as follows −
Round Function
The heart of this cipher is the DES function, f. The DES function applies a 48-bit key to the
rightmost 32 bits to produce a 32-bit output.
• Expansion Permutation Box − Since right input is 32-bit and round key is a
48-bit, we first need to expand right input to 48 bits. Permutation logic is
graphically depicted in the following illustration −
Key Generation
The round-key generator creates sixteen 48-bit keys out of a 56-bit cipher key. The process
of key generation is depicted in the following illustration −
The logic for Parity drop, shifting, and Compression P-box is given in the DES description.
DES Analysis
The DES satisfies both the desired properties of block cipher. These two properties make
cipher very strong.
• Avalanche effect − A small change in plaintext results in the very great change
in the ciphertext.
• Completeness − Each bit of ciphertext depends on many bits of plaintext.
During the last few years, cryptanalysis have found some weaknesses in DES when key
selected are weak keys. These keys shall be avoided.
DES has proved to be a very well designed block cipher. There have been no significant
cryptanalytic attacks on DES other than exhaustive key search.
Double-DES
C = EK2(EK1(P))
C = EK1(DK2(EK1(P)))
• although are no practical attacks on two key Triple-DES have some indications
• can use Triple-DES with Three-Keys to avoid even these
C = EK3(DK2(EK1(P)))
Virtually, all symmetric block encryption algorithms in current use are based on a structure
referred to as Fiestel block cipher. For that reason, it is important to examine the design
principles of the Fiestel cipher. We begin with a comparison of stream cipher with block cipher.
• A stream cipher is one that encrypts a digital data stream one bit or one byte at a time. E.g,
vigenere cipher. A block cipher is one in which a block of plaintext is treated as a whole and
used to produce a cipher text block of equal length. Typically a block size of 64 or 128 bits is
used.
• using idea of a product cipher in 1949 Claude Shannon introduced idea of substitution-
permutation (S-P) networks called modern substitution-transposition product cipher these
form the basis of modern block ciphers
• S-P networks are based on the two primitive cryptographic operations we have seen
before:
• substitution (S-box)
• permutation (P-box)
The input to the encryption algorithm are a plaintext block of length 2w bits and a key K.
the plaintext block is divided into two halves L0 and R0. The two halves of the data pass
through
“ n “ rounds of processing and then combine to produce the ciphertext block. Each round “ i “
has inputs Li-1 and Ri-1, derived from the previous round, as well as the subkey Ki, derived
from the overall key K. in general, the subkeys Ki are different from K and from each other.
All rounds have the same structure. A substitution is performed on the left half of the data
(as similar to S-DES). This is done by applying a round function F to the right half of the data
and then taking the XOR of the output of that function and the left half of the data. The round
function has the same general structure for each round but is parameterized by the round
subkey ki. Following this substitution, a permutation is performed that consists of the
interchange of the two halves of the data. This structure is a particular form of the substitution-
permutation network.
The exact realization of a Feistel network depends on the choice of the following
parameters and design features:
Key size - Increasing size improves security, makes exhaustive key searching harder, but
may slow cipher
Subkey generation - Greater complexity can make analysis harder, but slows cipher
Round function - Greater complexity can make analysis harder, but slows cipher
Fast software en/decryption & ease of analysis - are more recent concerns for practical
use and testing.
The process of decryption is essentially the same as the encryption process. The rule is as
follows: use the cipher text as input to the algorithm, but use the subkey ki in reverse order.
i.e., Kn in the first round, Kn-1 in second round and so on. For clarity, we use the notation LEi
and Rei for data traveling through the decryption algorithm. The diagram below indicates that,
at each round, the intermediate value of the decryption process is same (equal) to the
corresponding value of the encryption process with two halves of the value swapped.
After the last iteration of the encryption process, the two halves of the output are swapped, so
that the cipher text is RE16 || LE16. The output of that round is the cipher text. Now take the
cipher text and use it as input to the same algorithm. The input to the first round is RE16 ||
LE16, which is equal to the 32-bit swap of the output of the sixteenth round of the encryption
process.
Output(ciphertext)
Advantages of CBC –
• CBC works well for input greater than b bits.
• CBC is a good authentication mechanism.
• Better resistive nature towards cryptanalysis than ECB.
Disadvantages of CBC –
Parallel encryption is not possible since every encryption requires a previous cipher
The process is illustrated here:
.
Cipher Feedback Mode (CFB) –
In this mode the cipher is given as feedback to the next block of encryption with some new
specifications: first, an initial vector IV is used for first encryption and output bits are
divided as a set of s and b-s bits.The left-hand side s bits are selected along with plaintext
bits to which an XOR operation is applied. The result is given as input to a shift register
having b-s bits to lhs,s bits to rhs and the process continues. The encryption and
decryption process for the same is shown below, both of them use encryption algorithms.
Advantages of CFB –
• Since, there is some data loss due to the use of shift register, thus it is difficult
for applying cryptanalysis.
Disadvantages of using ECB –
• The drawbacks of CFB are the same as those of CBC mode. Both block losses
and concurrent encryption of several blocks are not supported by the
encryption. Decryption, however, is parallelizable and loss-tolerant.
Advantages of OFB –
• In the case of CFB, a single bit error in a block is propagated to all subsequent
blocks. This problem is solved by OFB as it is free from bit errors in the plaintext
block.
Disadvantages of OFB-
• The drawback of OFB is that, because to its operational modes, it is more
susceptible to a message stream modification attack than CFB.
Counter Mode –
The Counter Mode or CTR is a simple counter-based block cipher implementation. Every
time a counter-initiated value is encrypted and given as input to XOR with plaintext which
results in ciphertext block. The CTR mode is independent of feedback use and thus can be
implemented in parallel.
Its simple implementation is shown below:
Advantages of Counter –
• Since there is a different counter value for each block, the direct plaintext and
ciphertext relationship is avoided. This means that the same plain text can map
to different ciphertext.
• Parallel execution of encryption is possible as outputs from previous stages are
not chained as in the case of CBC.
Disadvantages of Counter-
• The fact that CTR mode requires a synchronous counter at both the transmitter
and the receiver is a severe drawback. The recovery of plaintext is erroneous
when synchronisation is lost.
Basic Approaches
Link to Link Encryption:
With link encryption, each vulnerable communications link is
equipped on both ends with an encryption device. Thus, all traffic over all communications
links is secured. One of its disadvantages is that the message must be decrypted each time
it enters a switch because the switch must read the address (logical connection number) in
the packet header in order to route the frame. Thus, the message is vulnerable at each
switch. If working with a public network, the user has no control over the security of the
nodes.
Several implications of link encryption should be noted. For this
strategy to be effective, all the potential links in a path from source to destination must use
link encryption. Each pair of nodes that share a link should share a unique key, with a
different key used on each link. Thus, many keys must be provided.
End-To-End Encryption
With end-to-end encryption, the encryption process is carried out
at the two end systems. The source host or terminal encrypts the data. The data in
encrypted form are then transmitted unaltered across the network to the destination terminal
or host. The destination shares a key with the source and so is able to decrypt the data. This
plan seems to secure the transmission against attacks on the network links or switches.
Thus, end-to-end encryption relieves the end user of concerns about the degree of security
of networks and links that support the communication. There is, however, still a weak spot.
Consider the following situation. A host connects to a frame relay
or ATM network, sets up a logical connection to another host, and is prepared to transfer
data to that other host by using end-to-end encryption. Data are transmitted over such a
network in the form of packets that consist of a header and some user data. What part of
each packet will the host encrypt? Suppose that the host encrypts the entire packet,
including the header. This will not work because, remember, only the other host can perform
the decryption. The frame relay or ATM switch will receive an encrypted packet and be
unable to read the header. Therefore, it will not be able to route the packet. It follows that the
host may encrypt only the user data portion of the packet and must leave the header in the
clear.
Thus, with end-to-end encryption, the user data are secure.
However, the traffic pattern is not, because packet headers are transmitted in the clear. On
the other hand, end-to-end encryption does provide a degree of authentication. If two end
systems share an encryption key, then a recipient is assured that any message that it
receives comes from the alleged sender, because only that sender shares the relevant key.
Such authentication is not inherent in a link encryption scheme.
To achieve greater security, both link and end-to-end encryption
are needed, as is shown in Figure 7.2. When both forms of encryption are employed, the
host encrypts the user data portion of a packet using an end-to-end encryption key. The
entire packet is then encrypted using a link encryption key. As the packet traverses the
network, each switch decrypts the packet, using a link encryption key to read the header,
and then encrypts the entire packet again for sending it out on the next link. Now the entire
packet is secure except for the time that the packet is actually in the memory of a packet
switch, at which time the packet header is in the clear.
Logical Placement of End-to-End Encryption Function
With link encryption, the encryption function is performed at a low
level of the communications hierarchy i.e. physical or link layers.
For end-to-end encryption, several choices are possible for the
logical placement of the encryption function. At the lowest practical level, the encryption
function could be performed at the network layer.
With network-layer encryption, Each end system can engage in an
encrypted exchange with another end system if the two share a secret key. All the user
processes and applications within each end system would employ the same encryption
scheme with the same key to reach a particular target end system.
Figure 7.4 illustrates the issues involved. In this example, an
electronic mail gateway is used to interconnect an internetwork that uses a TCP/IP-based
architecture. In such a configuration, there is no end-to-end protocol below the application
layer. The transport and network connections from each end system terminate at the mail
gateway, which sets up new transport and network connections to link to the other end
system. Even if both end systems use TCP/IP or OSI, there are plenty of instances in actual
configurations in which mail gateways sit between otherwise isolated internetworks. Thus,
for applications like electronic mail that have a store-and-forward capability, the only place to
achieve end-to-end encryption is at the application layer.
A drawback of application-layer encryption is that the number of entities to consider
increases dramatically. A network that supports hundreds of hosts may support thousands of
users and processes. Thus, many more secret keys need to be generated and distributed.
An interesting way of viewing the alternatives is to note that as we move up the
communications hierarchy, less information is encrypted but it is more secure.
With application-level encryption (Figure 7.5a), only the user data
portion of a TCP segment is encrypted. The TCP, IP, network-level, and link-level headers
and link-level trailer are in the clear. By contrast, if encryption is performed at the TCP level
(Figure 7.5b), then, on a single end-to-end connection, the user data and the TCP header
are encrypted. The IP header remains in the clear because it is needed by routers to route
the IP datagram from source to destination.
Note, however, that if a message passes through a gateway, the
TCP connection is terminated and a new transport connection is opened for the next hop.
Furthermore, the gateway is treated as a destination by the underlying IP. Thus, the
encrypted portions of the data unit are decrypted at the gateway. If the next hop is over a
TCP/IP network, then the user data and TCP header are encrypted again before
transmission. However, in the gateway itself the data unit is buffered entirely in the clear.
Finally, for link-level encryption (Figure 7.5c), the entire data unit except for the link header
and trailer is encrypted on each link, but the entire data unit is in the clear at each router and
gateway.
2. A third party can select the key and physically deliver it to A and B.
3. If A and B have previously and recently used a key, one party can
transmit the new key to the other, encrypted using the old key.
• Communication between end systems is encrypted using a temporary key, often referred to as a
session key.
• Typically, the session key is used for the duration of a logical connection and then discarded
• master key is shared by the key distribution center and an end system or user and used to encrypt
the session key.
❖ The KDC responds with a message encrypted using Ka Thus, A is the only one who
can successfully read the message, and A knows that it originated at the KDC. The
message includes two items intended for A:
• The one-time session key, Ks, to be used for the session
• The original request message, including the nonce, to enable A to match this response
with the appropriate request
Thus, A can verify that its original request was not altered before
reception by the KDC and, because of the nonce, that this is not a replay of some previous
request.
In addition, the message includes two items intended for B:
• The one-time session key, Ks to be used for the session
• An identifier of A (e.g., its network address), IDA
These last two items are encrypted with Kb (the master key that the KDC shares with B).
They are to be sent to B to establish the connection and prove A's identity.
❖ A stores the session key for use in the upcoming session and forwards to B the
information that originated at the KDC for B, namely, E(Kb, [Ks || IDA]). Because this
information is encrypted with Kb, it is protected from eavesdropping. B now knows
the session key (Ks), knows that the other party is A (from IDA), and knows that the
information originated at the KDC (because it is encrypted using Kb).
At this point, a session key has been securely delivered to A and B, and they may begin their
protected exchange. However, two additional steps are desirable:
❖ Using the newly minted session key for encryption, B sends a nonce, N2, to A.
❖ Also using Ks , A responds with f(N2), where f is a function that performs some
transformation on N2 (e.g., adding one).
These steps assure B that the original message it received (step 3) was not a replay.
Note that the actual key distribution involves only steps 1 through 3 but that steps 4 and 5,
as well as 3, perform an authentication function.
Major Issues with KDC:
For very large networks, a hierarchy of KDCs can be established.
For communication among entities within the same local domain, the local KDC is
responsible for key distribution. If two entities in different domains desire a shared key, then
the corresponding local KDCs can communicate through a (hierarchy of) global KDC(s)
To balance security & effort, a new session key should be used for
each new connection-oriented session. For a connectionless protocol, a new session key is
used for a certain fixed period only or for a certain number of transactions.
An automated key distribution approach provides the flexibility and
dynamic characteristics needed to allow a number of terminal users to access a number of
hosts and for the hosts to exchange data with each other, provided they trust the system to
act on their behalf.
The use of a key distribution center imposes the requirement that
the KDC be trusted and be protected from subversion. This requirement can be avoided if
key distribution is fully decentralized.
In addition to separating master keys from session keys, may wish
to define different types of session keys on the basis of use.
The Diffie-Hellman algorithm depends for its effectiveness on the difficulty of computing
The result is that two sides have exchanged a secret key.
The security of the algorithm lies in the fact that, while it is relatively easy to calculate
exponentials modulo a prime, it is very difficult to calculate discrete logarithms. For large
primes, the latter task is considered infeasible.
Diffie-Hellman Key Exchange
The protocol depicted in figure is insecure against a man-in-the-middle attack. Suppose
Alice and Bob wish to exchange keys, and Darth is the adversary. The attack proceeds as
follows:
In the second case, Darth wants to modify the message going to Bob. The key exchange
protocol is vulnerable to such an attack because it does not authenticate the participants.
This vulnerability can be overcome with the use of digital signatures and public-key
certificates.
5. INTRODUCTION TO NUMBER THEORY
where |x | is the largest integer less than or equal to x. Equation (4.1) is referred to as the division
algorithm.
Figure 4.1a demonstrates that, given a and positive n, it is always
possible to find q and r that satisfy the preceding relationship.
Represent the integers on the number line; a will fall somewhere on that
line (positive a is shown, a similar demonstration can be made for negative a). Starting at
0, proceed to n, 2n, up to qn, suchthat qn <=a and(q +1)n > a. The distance from qn to a
is r, and we have found the unique values of q and r. The remainder r is often referred to as
a residue.
Q2: The Euclidean Algorithm & Extended Euclidean Algorithm (Refer Notes)
Public key Cryptosystem − Asymmetric algorithms depends on one key for encryption and
a distinct but related key for decryption. These algorithms have the following characteristics
which are as follows −
• It is computationally infeasible to decide the decryption key given only
information of the cryptographic algorithm and the encryption key.
• There are two related keys such as one can be used for encryption, with the
other used for decryption.
A public key encryption scheme has the following ingredients which are as follows −
• Plaintext − This is the readable message or information that is informer into the
algorithm as input.
• Encryption algorithm − The encryption algorithm performs several conversion
on the plaintext.
• Public and Private keys − This is a set of keys that have been selected so that
if one can be used for encryption, and the other can be used for decryption.
• Ciphertext − This is scrambled message generated as output. It based on the
plaintext and the key. For a given message, there are two specific keys will
create two different ciphertexts.
• Decryption Algorithm − This algorithm get the ciphertext and the matching
key and create the original plaintext.
The keys generated in public key cryptography are too large including 512, 1024, 2048 and
so on bits. These keys are not simply to learn. Thus, they are maintained in the devices
including USB tokens or hardware security modules.
The major issue in public key cryptosystems is that an attacker can masquerade as a legal
user. It can substitutes the public key with a fake key in the public directory. Moreover, it can
intercepts the connection or alters those keys.
Public key cryptography plays an essential role in online payment services and ecommerce
etc. These online services are ensure only when the authenticity of public key and signature
of the user are ensure.
The asymmetric cryptosystem should manage the security services including confidentiality,
authentication, integrity and non-repudiation. The public key should support the security
services including non-repudiation and authentication. The security services of confidentiality
and integrity considered as an element of encryption process completed by private key of the
user.
Another type of threat that exist for data is the lack of message authentication. In this threat,
the user is not sure about the originator of the message. Message authentication can be
provided using the cryptographic techniques that use secret keys as done in case of
encryption.
Message Authentication Code (MAC)
MAC algorithm is a symmetric key cryptographic technique to provide message
authentication. For establishing MAC process, the sender and receiver share a symmetric key
K.
Essentially, a MAC is an encrypted checksum generated on the underlying message that is
sent along with a message to ensure message authentication.
The process of using MAC for authentication is depicted in the following illustration −
Hash functions are extremely useful and appear in almost all information security applications.
A hash function is a mathematical function that converts a numerical input value into another
compressed numerical value. The input to the hash function is of arbitrary length but output is
always of fixed length.
Values returned by a hash function are called message digest or simply hash values. The
following picture illustrated hash function −
Since, the hash value of first message block becomes an input to the second hash operation,
output of which alters the result of the third operation, and so on. This effect, known as
an avalanche effect of hashing.
Avalanche effect results in substantially different hash values for two messages that differ by
even a single bit of data.
Understand the difference between hash function and algorithm correctly. The hash function
generates a hash code by operating on two blocks of fixed-length binary data.
Hashing algorithm is a process for using the hash function, specifying how the message will
be broken up and how the results from previous message blocks are chained together.
Popular Hash Functions
Let us briefly see some popular hash functions −
Message Digest (MD)
MD5 was most popular and widely used hash function for quite some years.
• The MD family comprises of hash functions MD2, MD4, MD5 and MD6. It was
adopted as Internet Standard RFC 1321. It is a 128-bit hash function.
• MD5 digests have been widely used in the software world to provide assurance
about integrity of transferred file. For example, file servers often provide a pre-
computed MD5 checksum for the files, so that a user can compare the
checksum of the downloaded file to it.
• In 2004, collisions were found in MD5. An analytical attack was reported to be
successful only in an hour by using computer cluster. This collision attack
resulted in compromised MD5 and hence it is no longer recommended for use.
Secure Hash Function (SHA)
Family of SHA comprise of four SHA algorithms; SHA-0, SHA-1, SHA-2, and SHA-3. Though
from same family, there are structurally different.
• The original version is SHA-0, a 160-bit hash function, was published by the
National Institute of Standards and Technology (NIST) in 1993. It had few
weaknesses and did not become very popular. Later in 1995, SHA-1 was
designed to correct alleged weaknesses of SHA-0.
• SHA-1 is the most widely used of the existing SHA hash functions. It is
employed in several widely used applications and protocols including Secure
Socket Layer (SSL) security.
• In 2005, a method was found for uncovering collisions for SHA-1 within practical
time frame making long-term employability of SHA-1 doubtful.
• SHA-2 family has four further SHA variants, SHA-224, SHA-256, SHA-384, and
SHA-512 depending up on number of bits in their hash value. No successful
attacks have yet been reported on SHA-2 hash function.
• Though SHA-2 is a strong hash function. Though significantly different, its basic
design is still follows design of SHA-1. Hence, NIST called for new competitive
hash function designs.
• In October 2012, the NIST chose the Keccak algorithm as the new SHA-3
standard. Keccak offers many benefits, such as efficient performance and good
resistance for attacks.
HMAC algorithm stands for Hashed or Hash based Message Authentication Code. It is a
result of work done on developing a MAC derived from cryptographic hash functions. HMAC
is a great resistant towards cryptanalysis attacks as it uses the Hashing concept twice.
HMAC consists of twin benefits of Hashing and MAC, and thus is more secure than any
other authentication codes. RFC 2104 has issued HMAC, and HMAC has been made
compulsory to implement in IP security. The FIPS 198 NIST standard has also issued
HMAC.
Objectives –
As the Hash Function, HMAC is also aimed to be one way, i.e, easy to generate output from
input but complex the other way round.
It aims at being less effected by collisions than the hash functions.
HMAC reuses the algorithms like MD5 and SHA-1 and checks to replace the embedded
hash functions with more secure hash functions, in case found.
HMAC tries to handle the Keys in more simple manner.
HMAC Algorithm–
The working of HMAC starts with taking a message M containing blocks of length b bits. An
input signature is padded to the left of the message and the whole is given as input to a
hash function which gives us a temporary message digest MD’. MD’ again is appended to an
output signature and the whole is applied a hash function again, the result is our final
message digest MD.
Here is a simple structure of HMAC:
Here,
A digital signature is a mathematical technique which validates the authenticity and integrity
of a message, software or digital documents. It allows us to verify the author name, date and
time of signatures, and authenticate the message contents. The digital signature offers far
more inherent security and intended to solve the problem of tampering and impersonation
(Intentionally copy another person's characteristics) in digital communications.
The computer-based business information authentication interrelates both technology and the
law. It also calls for cooperation between the people of different professional backgrounds and
areas of expertise. The digital signatures are different from other electronic signatures not only
in terms of process and result, but also it makes digital signatures more serviceable for legal
purposes. Some electronic signatures that legally recognizable as signatures may not be
secure as digital signatures and may lead to uncertainty and disputes.
o Authentication
o Non-repudiation
o Integrity
Authentication
Authentication is a process which verifies the identity of a user who wants to access the
system. In the digital signature, authentication helps to authenticate the sources of messages.
Non-repudiation
Integrity
Integrity ensures that the message is real, accurate and safeguards from unauthorized user
modification during the transmission.
The key generation algorithm selects private key randomly from a set of possible private keys.
This algorithm provides the private key and its corresponding public key.
2. Signing algorithm
A signing algorithm produces a signature for the document.
Digital signatures are created and verified by using public key cryptography, also known as
asymmetric cryptography. By the use of a public key algorithm, such as RSA, one can
generate two keys that are mathematically linked- one is a private key, and another is a public
key.
The user who is creating the digital signature uses their own private key to encrypt the
signature-related document. There is only one way to decrypt that document is with the use
of signer's public key.
This technology requires all the parties to trust that the individual who creates the signature
has been able to keep their private key secret. If someone has access the signer's private key,
there is a possibility that they could create fraudulent signatures in the name of the private key
holder.
Different document processing platform supports different types of digital signature. They are
described below:
Certified Signatures
The certified digital signature documents display a unique blue ribbon across the top of the
document. The certified signature contains the name of the document signer and the certificate
issuer which indicate the authorship and authenticity of the document.
Approval Signatures
The approval digital signatures on a document can be used in the organization's business
workflow. They help to optimize the organization's approval procedure. The procedure
involves capturing approvals made by us and other individuals and embedding them within
the PDF document. The approval signatures to include details such as an image of our
physical signature, location, date, and official seal.
The visible digital signature allows a user to sign a single document digitally. This signature
appears on a document in the same way as signatures are signed on a physical document.
The invisible digital signatures carry a visual indication of a blue ribbon within a document in
the taskbar. We can use invisible digital signatures when we do not have or do not want to
display our signature but need to provide the authenticity of the document, its integrity, and its
origin.
Q7 authentication protocols:
User authentication is the first most priority while responding to the request made by the
user to the software application. There are several mechanisms made which are required
to authenticate the access while providing access to the data. In this blog, we will explore
the most common authentication protocols and will try to explore their merits and
demerits.
1. Kerberos :
Kerberos is a protocol that aids in network authentication. This is used for validating
clients/servers during a network employing a cryptographic key. It is designed for
executing strong authentication while reporting to applications. The overall implementation
of the Kerberos protocol is openly available by MIT and is used in many mass-produced
products.
Q8 Authentication Applications:
1. KERBEROS
Secure: A network eavesdropper should not be able to obtain the necessary information
to impersonate a user. More generally, Kerberos should be strong enough that a potential
opponent does not find it to be the weak link.
Reliable: For all services that rely on Kerberos for access control, lack of availability of
the Kerberos service means lack of availability of the supported services. Hence, Kerberos
should be highly reliable and should employ a distributed server architecture, with one system
able to back up another.
Transparent: Ideally, the user should not be aware that authentication is taking place,
beyond the requirement to enter a password.
Scalable: The system should be capable of supporting large numbers of clients and
servers. This suggests a modular, distributed architecture.
To support these requirements, the overall scheme of Kerberos is that of a trusted third-party
authentication service that uses a protocol based on that proposed by Needham and
Schroeder [NEED78] It is trusted in the sense that clients and servers trust Kerberos to
mediate their mutual authentication. Assuming the Kerberos protocol is well designed, then
the authentication service is secure if the Kerberos server itself is secure.
In an unprotected network environment, any client can apply to any server for service.
The obvious security risk is that of impersonation. To counter this threat, servers must be able
to confirm the identities of clients who request service. But in an open environment, this places
a substantial burden on each server.
An alternative is to use an authentication server (AS) that knows the passwords of all
users and stores these in a centralized database. In addition, the AS shares a unique
secret key with each server.
AS >> C: Ticket
EKv(IDc||ADc||IDv)
C: Client,
V: Server,
There are two major problems associated with the previous approach:
To solve these problems, we introduce a scheme for avoiding plaintext passwords, and anew
server, known as ticket granting server (TGS). The hypothetical scenario is as follows:
Ekv(IDc||ADc||IDv||TS2||Lifetime2)
V: Server,
The new service, TGS, issues tickets to users who have been authenticated to AS. Thus, the
user first requests a ticket-granting ticket (Tickettgs) from the AS. The client module in the user
workstation saves this ticket. Each time the user requires access to a new service, the client
applies to the TGS, using the ticket to authenticate itself. The TGS then grants a ticket for the
particular service. The client saves each service-granting ticket and uses it to authenticate its
user to a server each time a particular service is requested.
7. BASIC OVERVIEW OF: e-mail, IP & WEB Security
PGP (Pretty Good Privacy), is a popular program that is used to provide confidentiality
and authentication services for electronic mail and file storage. It was designed by Phil
Zimmermann way back in 1991. He designed it in such a way, that the best cryptographic
algorithms such as RSA, Diffie-Hellman key exchange, DSS are used for the public-key
encryption (or) asymmetric encryption; CAST-128, 3DES, IDEA are used for symmetric
encryption and SHA-1 is used for hashing purposes. PGP software is an open source one
and is not dependent on either the OS (Operating System) or the processor. The
application is based on a few commands which are very easy to use.
The following are the services offered by PGP:
1. Authentication
2. Confidentiality
3. Compression
4. Email Compatibility
5. Segmentation
As shown in the above figure, the Hash Function (H) calculates the Hash Value of the
message. For the hashing purpose, SHA-1 is used and it produces a 160 bit output hash
value. Then, using the sender’s private key (KPa), it is encrypted and it’s called as Digital
Signature. The Message is then appended to the signature. All the process happened till
now, is sometimes described as signing the message . Then the message is compressed
to reduce the transmission overhead and is sent over to the receiver.
At the receiver’s end, the data is decompressed and the message, signature are obtained.
The signature is then decrypted using the sender’s public key(PUa) and the hash value is
obtained. The message is again passed to hash function and it’s hash value is calculated
and obtained.
Both the values, one from signature and another from the recent output of hash function
are compared and if both are same, it means that the email is actually sent from a known
one and is legit, else it means that it’s not a legit one.
2. Confidentiality:
Sometimes we see some packages labelled as ‘Confidential’, which means that those
packages are not meant for all the people and only selected persons can see them. The
same applies to the email confidentiality as well. Here, in the email service, only the
sender and the receiver should be able to read the message, that means the contents
have to be kept secret from every other person, except for those two.
PGP provides that Confidentiality service in the following manner:
The message is first compressed and a 128 bit session key (K s), generated by the PGP, is
used to encrypt the message through symmetric encryption. Then, the session key (K s)
itself gets encrypted through public key encryption (EP) using receiver’s public key(KU b) .
Both the encrypted entities are now concatenated and sent to the receiver.
As you can see, the original message was compressed and then encrypted initially and
hence even if any one could get hold of the traffic, he cannot read the contents as they are
not in readable form and they can only read them if they had the session key (K s). Even
though session key is transmitted to the receiver and hence, is in the traffic, it is in
encrypted form and only the receiver’s private key (KP b)can be used to decrypt that and
thus our message would be completely safe.
At the receiver’s end, the encrypted session key is decrypted using receiver’s private key
(KPb) and the message is decrypted with the obtained session key. Then, the message is
decompressed to obtain the original message (M).
RSA algorithm is used for the public-key encryption and for the symmetric key encryption,
CAST-128(or IDEA or 3DES) is used.
Practically, both the Authentication and Confidentiality services are provided in parallel as
follows :
Note:
M – Message
H – Hash Function
Ks – A random Session Key created for Symmetric Encryption purpose
DP – Public-Key Decryption Algorithm
EP – Public-Key Encryption Algorithm
DC – Asymmetric Decryption Algorithm
EC – Symmetric Encryption Algorithm
KPb – A private key of user B used in Public-key encryption process
KPa – A private key of user A used in Public-key encryption process
PUa – A public key of user A used in Public-key encryption process
PUb – A public key of user B used in Public-key encryption process
|| – Concatenation
Z – Compression Function
Z-1 – Decompression Function
E-mail Hacking
Email hacking can be done in any of the following ways:
• Spam
• Virus
• Phishing
Spam
E-mail spamming is an act of sending Unsolicited Bulk E-mails (UBI) which one has not
asked for. Email spams are the junk mails sent by commercial companies as an advertisement
of their products and services.
Virus
Some emails may incorporate with files containing malicious script which when run on your
computer may lead to destroy your important data.
Phishing
Email phishing is an activity of sending emails to a user claiming to be a legitimate enterprise.
Its main purpose is to steal sensitive information such as usernames, passwords, and credit
card details.
Such emails contains link to websites that are infected with malware and direct the user to
enter details at a fake website whose look and feels are same to legitimate one.
E-mail Spamming and Junk Mails
Email spamming is an act of sending Unsolicited Bulk E-mails (UBI) which one has not asked
for. Email spams are the junk mails sent by commercial companies as an advertisement of
their products and services.
Spams may cause the following problems:
• It floods your e-mail account with unwanted e-mails, which may result in loss of
important e-mails if inbox is full.
• Time and energy is wasted in reviewing and deleting junk emails or spams.
• It consumes the bandwidth that slows the speed with which mails are delivered.
• Some unsolicited email may contain virus that can cause harm to your
computer.
Blocking Spams
Following ways will help you to reduce spams:
• While posting letters to newsgroups or mailing list, use a separate e-mail
address than the one you used for your personal e-mails.
• Don’t give your email address on the websites as it can easily be spammed.
• Avoid replying to emails which you have received from unknown persons.
• Never buy anything in response to a spam that advertises a product.
E-mail Cleanup and Archiving
In order to have light weighted Inbox, it’s good to archive your inbox from time to time. Here I
will discuss the steps to clean up and archive your Outlook inbox.
• Select File tab on the mail pane.
• Select Cleanup Tools button on account information screen.
• Select Archive from cleanup tools drop down menu.
• Select Archive this folder and all subfolders option and then click on the
folder that you want to archive. Select the date from the Archive items older
than: list. Click Browse to create new .pst file name and location. Click OK.
Q2: IP Security:
The IP security (IPSec) is an Internet Engineering Task Force (IETF) standard suite of
protocols between 2 communication points across the IP network that provide data
authentication, integrity, and confidentiality. It also defines the encrypted, decrypted and
authenticated packets. The protocols needed for secure key exchange and key
management are defined in it.
Uses of IP Security –
IPsec can be used to do the following things:
• To encrypt application layer data.
• To provide security for routers sending routing data across the public internet.
• To provide authentication without encryption, like to authenticate that the data
originates from a known sender.
• To protect network data by setting up circuits using IPsec tunneling in which all
data is being sent between the two endpoints is encrypted, as with a Virtual
Private Network(VPN) connection.
Components of IP Security –
It has the following components:
1. Encapsulating Security Payload (ESP) –
It provides data integrity, encryption, authentication and anti replay. It also
provides authentication for payload.
2. Authentication Header (AH) –
It also provides data integrity, authentication and anti replay and it does not
provide encryption. The anti replay protection, protects against unauthorized
transmission of packets. It does not protect data’s confidentiality.
Working of IP Security –
1. The host checks if the packet should be transmitted using IPsec or not. These
packet traffic triggers the security policy for themselves. This is done when the
system sending the packet apply an appropriate encryption. The incoming
packets are also checked by the host that they are encrypted properly or not.
2. Then the IKE Phase 1 starts in which the 2 hosts( using IPsec ) authenticate
themselves to each other to start a secure channel. It has 2 modes. The Main
mode which provides the greater security and the Aggressive mode which
enables the host to establish an IPsec circuit more quickly.
3. The channel created in the last step is then used to securely negotiate the way
the IP circuit will encrypt data across the IP circuit.
4. Now, the IKE Phase 2 is conducted over the secure channel in which the two
hosts negotiate the type of cryptographic algorithms to use on the session and
agreeing on secret keying material to be used with those algorithms.
5. Then the data is exchanged across the newly created IPsec encrypted tunnel.
These packets are encrypted and decrypted by the hosts using IPsec SAs.
6. When the communication between the hosts is completed or the session times
out then the IPsec tunnel is terminated by discarding the keys by both the
hosts.
Web Security is very important nowadays. Websites are always prone to security
threats/risks. Web Security deals with the security of data over the internet/network or web
or while it is being transferred to the internet. For e.g. when you are transferring data
between client and server and you have to protect that data that security of data is your web
security.
Hacking a Website may result in the theft of Important Customer Data, it may be the credit
card information or the login details of a customer or it can be the destruction of one’s
business and propagation of illegal content to the users while somebody hacks your website
they can either steal the important information of the customers or they can even propagate
the illegal content to your users through your website so, therefore, security considerations
are needed in the context of web security.
Security Threats:
A Threat is nothing but a possible event that can damage and harm an information system.
Security Threat is defined as a risk that which, can potentially harm Computer systems &
organizations. Whenever an Individual or an Organization creates a website, they are
vulnerable to security attacks.
Security attacks are mainly aimed at stealing altering or destroying a piece of personal and
confidential information, stealing the hard drive space, and illegally accessing passwords.
So whenever the website you created is vulnerable to security attacks then the attacks are
going to steal your data alter your data destroy your personal information see your
confidential information and also it accessing your password.
Web security threats are constantly emerging and evolving, but many threats consistently
appear at the top of the list of web security threats. These include:
• Cross-site scripting (XSS)
• SQL Injection
• Phishing
• Ransomware
• Code Injection
• Viruses and worms
• Spyware
• Denial of Service
Security Consideration:
• Updated Software: You need to always update your software. Hackers may be
aware of vulnerabilities in certain software, which are sometimes caused by bugs
and can be used to damage your computer system and steal personal data. Older
versions of software can become a gateway for hackers to enter your network.
Software makers soon become aware of these vulnerabilities and will fix
vulnerable or exposed areas. That’s why It is mandatory to keep your software
updated, It plays an important role in keeping your personal data secure.
• Beware of SQL Injection: SQL Injection is an attempt to manipulate your data
or your database by inserting a rough code into your query. For e.g. somebody
can send a query to your website and this query can be a rough code while it gets
executed it can be used to manipulate your database such as change tables,
modify or delete data or it can retrieve important information also so, one should
be aware of the SQL injection attack.
• Cross-Site Scripting (XSS): XSS allows the attackers to insert client-side
script into web pages. E.g. Submission of forms. It is a term used to describe a
class of attacks that allow an attacker to inject client-side scripts into other users’
browsers through a website. As the injected code enters the browser from the
site, the code is reliable and can do things like sending the user’s site
authorization cookie to the attacker.
• Error Messages: You need to be very careful about error messages which are
generated to give the information to the users while users access the website and
some error messages are generated due to one or another reason and you
should be very careful while providing the information to the users. For e.g. login
attempt – If the user fails to login the error message should not let the user know
which field is incorrect: Username or Password.
• Data Validation: Data validation is the proper testing of any input supplied by
the user or application. It prevents improperly created data from entering the
information system. Validation of data should be performed on both server-side
and client-side. If we perform data validation on both sides that will give us the
authentication. Data validation should occur when data is received from an
outside party, especially if the data is from untrusted sources.
• Password: Password provides the first line of defense against unauthorized
access to your device and personal information. It is necessary to use a strong
password. Hackers in many cases use sophisticated software that uses brute
force to crack passwords. Passwords must be complex to protect against brute
force. It is good to enforce password requirements such as a minimum of eight
characters long must including uppercase letters, lowercase letters, special
characters, and numerals.