Isc Js Notes
Isc Js Notes
1. Introduction
Computer data often travels from one computer to another, leaving the safety of its
protected physical surroundings. Once the data is out of hand, people with bad intention
could modify or forge your data, either for amusement or for their own benefit.
Cryptography can reformat and transform our data, making it safer on its trip between
computers. The technology is based on the essentials of secret codes, augmented by modern
mathematics that protects our data in powerful ways.
1. Computer Security: Generic name for the collection of tools designed to protect data
and to prevent hackers.
2. Network Security: Measures to protect data during their transmission.
3. Internet Security: Measures to protect data during their transmission over a
collection of interconnected networks.
Security Attacks, Services and Mechanisms:
To assess the security needs of an organization effectively, the manager responsible
for security needs some systematic way of defining the requirements for security and
characterization of approaches to satisfy those requirements. One approach is to consider
three aspects of information security:
1. Security Attack: Any action that compromises the security of information owned by
an organization.
2. Security Mechanism: A mechanism that is designed to detect, prevent or recover
from a security attack.
3. Security Service: A service that enhances the security of the data processing systems
and the information transfers of an organization. The services are intended to counter
2. Interception:
Here the message is accessed by an unauthorized user during the process of the
transmission. Here the receiver receives the message and not unaware of the introducers. This
is called attack on “Confidentiality”.
3. Modification:
Here the intruders or unauthorized party gains the access over the communication channel
and retrieves the message from the sender and then modifies it, and send it to receiver. This
is called as an “Attack on Integrity”.
The requirement in this scheme both sender and receiver should know the key in the
same way.
Explanation:
1. Plain Text: This is the general English language which can be understood by
any person.
2. Cipher Text: This is resultant after applying encryption algorithm on the plain
text with respect to the key.
Trusted computer systems can be used to implement this model. By Using this model
requires us to:
1. Select appropriate gatekeeper functions to identify users.
2. Implement security controls to ensure only authorized users access designated
information or resources.
Conventional Encryption:
This is referred as conventional / private-key / single-key. The Sender and Recipient
share a common key. All classical encryption algorithms are private-key was only type prior
to invention of public key in 1970. The plaintext is known as original message. The
following basic terminologies used:
The ciphertext alphabet for the cipher where we replace each letter by the next letter in the alphabet
There are many different mono-alphabetic substitution ciphers, in fact infinitely
many, as each letter can be encrypted to any symbol, not just another letter.
[INFORMATION SECURITY AND CRYPTOGRAPHY NOTES(K.G.R.L P.G COLLEGE)]
Homophonic Substitution Cipher:
The Homophonic Substitution cipher is a substitution cipher in which single plaintext
letters can be replaced by any of several different ciphertext letters. They are generally much
more difficult to break than standard substitution ciphers.
The number of characters each letter is replaced by is part of the key, e.g. the letter 'E'
might be replaced by any of 5 different symbols, while the letter 'Q' may only be substituted
by 1 symbol.
The easiest way to break standard substitution ciphers is to look at the letter
frequencies, the letter 'E' is usually the most common letter in English, so the most common
ciphertext letter will probably be 'E' (or perhaps 'T'). If we allow the letter 'E' to be replaced
by any of 3 different characters, then we can no longer just take the most common letter,
since the letter count of 'E' is spread over several characters. As we allow more and more
possible alternatives for each letter, the resulting cipher can become very secure.
Ex: Let cipher alphabet is as follows:
To encipher the message "DEFEND THE EAST WALL OF THE CASTLE", we find
'D' in the top row, and then replace it with the letter below it, 'F'. The second letter, 'E'
provides us with several choices, we could use any of 'Z', '7', '2' or '1'. We choose one of these
at random, say '7'. After continuing with this, we get the ciphertext:
The number of ciphertext letters assigned to each plaintext letter was chosen to flatten
the frequency distribution as much as possible. Since 'E' is normally the most common letter,
it is allowed more possibilities so that the frequency peak from the letter 'E' will not be
present in the ciphertext.
In the above figure, HELLO could be replaced by YUQQW, but HELL could be
replaced by a totally different cipher text block TEUI. This shows that in this technique the
replacement of plain text happens block-by-block, rather than character-by-character.
Polyalphabetic Ciphers:
To improve on the simple monoalphabetic technique is to use different
monoalphabetic substitutions as one proceeds through the plaintext message. The general
name for this approach is polyalphabetic substitution cipher. All these techniques have the
following features in common:
1. A set of related mono-alphabetic substitution rules is used.
2. A key determines which particular rule is chosen for a given transformation.
The best known, and one of the simplest, such algorithm is referred to as the Vigenère
cipher. In this scheme, the set of related mono-alphabetic substitution rules consists of the 26
Caesar ciphers, with shifts of 0 through 25. Each cipher is denoted by a key letter, which is
the ciphertext letter that substitutes for the plaintext letter a. Thus, a Caesar cipher with a
2. Columnar Transposition:
The message is written out in rows of a fixed length, and then read out again column
by column, and the columns are chosen in some scrambled order. Both the width of the rows
and the permutation of the columns are usually defined by a keyword.
For example, the word ZEBRAS is of length 6 (so the columns are of length 6), and
the permutation is defined by the alphabetical order of the letters in the keyword. In this case,
the order would be "6 3 2 4 1 5".
In a regular columnar transposition cipher, any spare spaces are filled with nulls; in an
irregular columnar transposition cipher, the spaces are left blank. Finally, the message is read
off in columns, in the order specified by the keyword. For example, suppose we use the
keyword ZEBRAS and the message WE ARE DISCOVERED FLEE AT ONCE. In a regular
columnar transposition, we write this into the grid as:
The above matrix consist five nulls (QKJEU) at the end. Now the cipher text is:
6. Based on these values, all three persons now calculate their keys as shown in the following
figure. We will notice that Alice calculates only K1, Bob calculates only K2, whereas Tom
calculates both K1 and K2.
As we can see, the MIMA can work against the DH key exchange algorithm, causing
it to fail. This is plainly because the man-in-the-middle makes the actual communicators
believe that they are talking to each other, whereas they are actually talking to the man-in-
the-middle, who is talking to each of them.
This attack can be prevented if Alice and Bob authenticate each other before
beginning to exchange information. This provides to Alice is Bob is indeed Bob and not
someone else (e.g. Tom) posing as Bob. Similarly, Bob can also get convenience that Alice is
genuine as well.
Note: Why Tom needs two Keys? Tom wants to communicate with Alice securely using a
shared symmetric key (9) and on the other hand, he wants to communicate with Bob securely
using a different shared symmetric key (5). Only then he can receive messages from Alice
and Bob, both will(incorrectly) believe that they are directly communicating with each other
i.e. Alice will feel that the key 9 is shared between her and Bob, whereas Bob will feel that
the key 5 is shared between him and Alice. Actually, what is happening is, Tom sharing the
1. Criminal Attacks: These attacks are simplest to understand. The main objective of these
attackers is to maximize financial gain by attacking computer systems. The different types of
criminal attacks are:
a. Fraud: Modern fraud attacks concentrate on manipulating some aspects of electronic
currency, credit cards, electronic stock certificates, checks, letters of credit, purchase orders,
ATMs, etc.
b. Scams: Scams come in various forms, some of the most common ones being sale of
services, auctions, multi-level marketing schemes, general merchandise and business losing
their money. A very common example is the Nigeria scam, where an email from Nigeria (and
other African countries) entices people to deposit money into a bank account with a promise
of hefty gains. Whosoever gets caught in this scam loses money heavily.
c. Destruction: Some sort of grudge is the motive behind such attacks. For example,unhappy
employees attack their own organization, Whereas terrorists „strike at much bigger levels. For
example, in the year 2000, there was an attack against popular Internet sites such as yahoo,
CNN, eBay, Buy.com, Amazon.com, and e-Trade where authorized users of these sites failed
to log in or access these sites.
d. Identity theft: This is best understood with a quote from Bruce Schneider: Why steal from
someone when you can just become that person? In other words, an attacker does not steal
anything from a legitimate user-he/she becomes that legitimate user„: For example, it is
much easier to get the password of someone else‟s bank account, or to actually be able to get
a credit card on someone else‟s name. Then that privilege can be misused until it gets
detected.
Cookies:
A cookie is a message given to a web browser by a web server. The browser stores the
message in a text file. The message is then sent back to the server each time the browser
requests a page from the server. Cookies are classified into two types. They are
1. stateful – keep track of the previously stored information which is used for current
transaction.
2. stateless – every transaction is performed as if it were being done for the very first
time. There is no previously stored information used for the current transaction.
A stateless protocol does not require the server to retain session information or status
about each communications partner for the duration of multiple requests. In contrast, a
protocol that requires keeping of the internal state on the server is known as
a stateful protocol.
The right-hand side is the product over all possible prime numbers; for any particular
value of, most of the exponents ap will be 0.
Additive Inverse:
The additive inverse is defined as its inverse element under the binary operation of
addition, which allows a broad generalization to mathematical objects other than numbers
i.e., additive inverse of a number a is the number that, when added to a, yields zero. This
number is also known as the opposite (number), sign change, and negation. For a real
number, it reverses its sign: the opposite to a positive number is negative, and the opposite to
a negative number is positive. Zero is the additive inverse of itself.
Ex: The additive inverse of a is denoted by unary minus: −a. For example, the additive
inverse of 7 is −7, because 7 + (−7) = 0, and the additive inverse of −0.3 is 0.3, because
−0.3 + 0.3 = 0.
Multiplicative Inverse:
A multiplicative inverse or reciprocal for a number x, denoted by 1/x or x−1, is a
number which when multiplied by x yields the multiplicative identity, 1. The multiplicative
inverse of a fraction a/b is b/a. For the multiplicative inverse of a real number, divide 1 by the
number. For example, the reciprocal of 5 is one fifth (1/5 or 0.2), and the reciprocal of 0.25 is
1 divided by 0.25, or 4. The reciprocal function, the function f(x) that maps x to 1/x, is one
of the simplest examples of a function which is its own inverse.
Modular Multiplicative Inverse:
The modular multiplicative inverse is an integer 'x' such that:
ax ≡ 1 (mod m) can be written as ax mod m = 1, where a and m are integers.
The value of 'x' should be in {0, 1, 2, … m-1}, i.e., in the ring of integer modulo m.
2. Input: a = 10, m = 17
Output: 12
Since (10*12) mod 17 = 1, 12 is modulo inverse of 10.
*************
The 64-bit plaintext block is arranged in 8x8 matrix format as the following:
3. 32-bit Swap:
The output of 16th round is divided into two 32-bit halves (left half and right half).
Now they are swapped and generated 64-bit output.
4. Generation of Sub Keys:
A total of 16 sub keys are required and each one size is 48-bits because there are 16
rounds in DES algorithm. But the input key size is 56-bits.
Reduced Permutation:
The two 28-bit blocks are grouped into 56-bit block. This passes through a reduced
permutation giving 48-bit block output, representing the key Ki. The general format of
reduced permutation function is:
The overall processing at each round can be summarized in the following formulas:
The round key Ki is 48 bits. The R input is 32 bits. This R input is first expanded to 48
bits by using a table that defines a permutation plus an expansion that involves duplication of
16 of the R bits. The resulting 48 bits are XORed with Ki.
This 48-bit result passes through a substitution function that produces a 32-bit output,
which is permuted as defined by the following table.
S-Box Rule:
This scheme involves a key length of 56 * 2 = 112 bits. It will increase the key space
and security.
Suppose it is true that, given two key values it is possible to find a key value K3 such
that
EK2(EK1(P) ) = EK3(P).
If the above equation holds double DES becomes useless and it is equivalent to a
Single DES. So, we assume that if DES is used twice as in the above diagram with two
different keys, it will produce a cipher text and we will not get that cipher text with any
possible single key application of DES i.e., the above equation will not be hold.
Meet in the Middle Attack (MIMA):
Suppose sender and receiver are going to use Double DES algorithm, then the intruder
proceeds according to a scheme that does not depend upon any property of DES, but will
work. The attack is described as the following.
The intruder observes that C = EK2(EK1(P)), X = EK1(P) = DK2(C).
Suppose the intruder knows a pair (P, C). He proceeds in the following way.
The intruder first encrypts the plain text P with all possible 256 keys of K1. Now he
stores all the 256 resultant values in the table and sort them according to their values. Now the
intruder decrypts the cipher text with all possible 2 56 key values of K2. At the end of each
decryption we get a 64 – bit value for X. This value is compared against the table for a match.
If the match occurs then the intruder takes the corresponding K1 and K2. Now these two keys
In this method, k-bits at a time are generated and Exclusive ored with k-bits of plain
text. In CFB, the k-bits shifted in are the k-bits of cipher text from the previous block. So, in
CFB the one-time pad cannot be generated before the message is known.
Decryption:
Now, suppose that many pairs of inputs to f with the same difference yield the same
output difference if the same sub key is used. To put this more precisely, let us say that X
may cause Y with probability p, if for a fraction p of the pairs in which the input XOR is X,
the output XOR equals Y. We want to suppose that there are a number of values of that have
high probability of causing a particular output difference. Therefore, if we know dmi-1 and
dmi with high probability, then we know dmi+1 with high probability. Furthermore, if a
number of such differences are determined, it is feasible to determine the sub-key used in the
function f.
The overall strategy of differential cryptanalysis is based on these considerations for a
single round. The procedure is to begin with two plaintext messages m and m' with a given
difference and trace through a probable pattern of differences after each round to yield a
probable difference for the cipher text. Actually, there are two probable patterns of
differences for the two 32-bit halves. Next, we submit the plain text for encryption to
determine the actual difference under the unknown key and compare the result to the
probable difference. If there is a match, then we suspect that all the probable patterns at all
the intermediate rounds are correct. With that assumption, we can make some deductions
about the key bits. This procedure must be repeated many times to determine all the key bits.
Linear Cryptanalysis:
A more recent development is linear cryptanalysis. This attack is based on finding
linear approximations to describe the transformations performed in DES. This method can
find a DES key given known plaintexts, as compared to chosen plaintexts for differential
cryptanalysis. Although this is a minor improvement, because it may be easier to acquire
known plaintext rather than chosen plaintext, it still leaves linear cryptanalysis infeasible as
an attack on DES. So far, little work has been done by researchers to validate the linear
cryptanalytic approach.
Explanation:
Sub key Generation : First we consider the 128-bits key. It is divided into 8 equal parts. The
first part is called Z1, second part is called Z2 and so on. The last part is Z8. In this way we
generate Z1 to Z8 keys i.e., Z1 ( 1 ..16 ), Z2 ( 17 .. 32 ), Z3 ( 33 .. 48 ), Z4 ( 49 .. 64), Z5 ( 65 ..
80 ), Z6(81 .. 96 ), Z7 ( 97 .. 112), Z8 ( 113 .. 128 ).
Now we perform circular left shift of 25-bits on the given key to get 26 .. 128, 1 .. 25.
We divide these bits into 8 equal parts and call them as Z9 to Z16 i.e., Z9 [ 26 .. 41 ], Z10 [ 42 ..
57 ], Z11 [ 57 .. 73 ], Z12 [ 74 .. 89 ], Z13 [ 90 .. 105 ], Z14 [ 106 .. 121 ], Z15 [ 122, 123, 124,
125, 126, 127, 128, 1 .. 9 ], Z16 [ 10 .. 25 ].
Now again we perform circular left shift of 25-bits on the above input to get
51 .. 128, 1 .. 25, 26 .. 50.
From the above diagram we observe that each round takes a 64-bit input and produces
64-bit input and produces 64-bit output. Each odd round takes 4-keys where as each even
round takes 2 keys.
Each round takes four 16-bit values as output. The following is the structure of odd
round. The odd round „i‟ takes four 16-bit values namely Xa, Xb, Xc and Xd as inputs with
keys Ka, Kb, Kc and Kd and produce Xa, Xb, Xc and Xd as outputs. The following diagram
explains this concept.
Initially Xa, Xb are Exclusive ored to get Yin. Xc, Xd are Exclusive ored to get Zin.
i.e., Yin = Xa Xb
Zin = Xc Xd
Now Yin, Zin are given to Mangler function with Ke, Kf. It gives two outputs Yout, Zout.
Yout = [ ( Ke Yin ) Zin ] Kf
Zout = ( Ke Yin ) + Yout
Finally Yout is added to Xa to get new Xa, Yout is added to Xb to get new Xb. Zout is
added to Xc to get new Xc, Zout is added to Xd to get Xd.
i.e., Xa = Xa Yout
Xb = Xb Yout
Xc = Xc Zout
Xd = Xd Zout
IDEA Decryption:
In IDEA decryption the 64-bit cipher text is converted into 64-bits plain text using the
same 128-bits key.
The 64-bit cipher text undergoes 8-rounds and output transformation to get 64-bit
plain text. In decryption process we require 52 sub keys of 16-bits each. These are labeled as
U1, U2, U3, ……… U52. These keys are identical to Z1 to Z52 with some permutation; minor
changes i.e., the decryption keys are generated by using the encryption keys in the following
way.
Note 1:
, .
Important Definitions:
P-Box:
In cryptography, a permutation box (or P-box) is a method of bit-shuffling used to
permute or transpose bits across S-boxes inputs, retaining diffusion while transposing.
Diffusion and Confusion:
Confusion means that each character of the cipher text should depend on several parts
of the key. Diffusion means that if we change a character of the plaintext, then several
characters of the cipher text should change, and similarly, if we change a character of the
cipher text, then several characters of the plaintext should change.
Blowfish was designed in 1993 by Bruce Scheier as a fast, alternative to existing encryption
algorithms such AES, DES and 3 DES etc.
Blowfish Encryption Algorithm:
Blowfish is a symmetric block encryption algorithm designed in consideration with:
1. Fast : It encrypts data on large 32-bit microprocessors at a rate of 26 clock cycles per
byte.
2. Compact: It can run in less than 5K of memory.
3. Simple: It uses addition, XOR, lookup table with 32-bit operands.
4. Secure: The key length is variable ,it can be in the range of 32~448 bits: default 128
bits key length.
5. It is suitable for applications where the key does not change often, like
communication link or an automatic file encryptor.
6. Unpatented and royality-free.
Each round in the AES algorithm contains 4 stages except the last round. They are
i) Sub Bytes Step
ii) Shift Row Step
iii) Mix Column Step
iv) Add Round key Step
i) Sub Bytes Step:
In sub bytes step each byte of the input is updated using S-box to get an output byte.
This operation provides a non-linearity in the input. The S-box is generally derived from the
inverse functions. The following diagram explains this idea.
The cryptosystem depends on a cryptographic algorithm based on two related keys. Diffie
and Hellman proposed this system without demonstrating that such algorithms exist.
However, they did lay out the conditions that such algorithms must fulfill [DIFF76b]:
2. We would now think, we are back to square one! We have encrypted the plain text (PT)
with a symmetric-key operation. We must now transport this one-time symmetric key (K1) to
the server so that the server can decrypt the cipher text (CT) to get back the original plain-text
message (PT). Does this not again lead us to the key-exchange problem? Well, a novel
concept is used now. A now takes the one-time symmetric key of step1 (i.e. K1), and encrypts
K1 with B‟s public key (K2). This process is called key wrapping of the symmetric key, and is
shown in fig. below. We have shown that the symmetric key K1 goes inside a logical box,
which is sealed by B‟s public key (i.e. K2).
4. The sender (A) now sends the digital envelope [which contains the cipher text (CT) and the
onetime symmetric key (K1) encrypted with B‟s public key, (K2)] to B using the underlying
transport mechanism (network). This is shown in fig .we do not show the contents of the
envelope, and assume that the envelope contains the two entities, as discussed.
5. B receives digital envelope and opens it. After B opens this digital envelope, he gets 2
things first is cipher text (CT) and another one is the one-time session key (K1) which is
encrypted using B‟s public key (K2). This is shown in the following figure:
7. Finally, B applies the same symmetric-key algorithm as was used by A, and the symmetric
key K1 to decrypt the cipher text (C1). This process yields the original plain text (PT), as
shown in the following figure:
1. First idea: convert a secret key algorithm into a message digest algorithm for arbitrary
messages
2. Used e.g. to store hashes of UNIX passwords instead of the passwords it selves
3. Given: A secret key algorithm with key bits and message block length b bits (e.g.
DES: k=56 and b=64)
Algorithm:
Split message m into k-bit chunks m1, m2, ...
Use m1 as a key to encrypt a “constant”
Use m2 to encrypt the previous result
.............
Use the final b-bit result as message digest
From the above compression function, the following functions are used.
d0 = d3 CLS = Circular Left Shift
In the MD5 algorithm, we add a Ti value in each step. The Ti value is found in the
following way. It is equal to an integer part of 232 * abs ( sin ( i ) ).
E.g. : T [ 1 ] = Integer part of 232 * abs ( sin ( 1 ) )
= D7A6A478
In MD5 algorithm we use Xi values. The Xi values are calculated in the following
way. First, we have to consider the 512 bits input to the round. It divided into 16 equal parts
The Secure Hash Algorithm takes an arbitrary length of input message and produces a
160-bit message digest value.
The algorithm proceeds in the following way:
1. Take message and add padding (1 followed by 0‟s) so that the entire message length,
including the padding, is evenly divided by 512.
2. The SHA algorithm works on blocks of 512.
3. Establish Wn for processing such that 0 <= n <= 79
a) Wn is a length of 32 bits
b) Segment the 512 bit block into 16 blocks of 32 bits to obtain W0
through W15
c) Starting with n=16, use the following calculation to obtain W16
through W79: Wn = Wn-3 Wn-8 Wn-14 Wn-16
4. The SHA-1 uses a 160 bit buffer. It is divided into Five 32 bit registers
called A, B, C, D and E. The initialized values of A, B, C, D, and E are as
follows:
A = 67452301 B = EFCDAB89 C = 98BADCFE D = 10325476
E = C3D2E1F0
5. For each round from 0 through 79 A, B, C, D, and E are processed as follows:
A = E + (A 5) + Wt + Kt + f(t, B, C, D)
B = old A
C = old B 30
D = old C
E = old D
Where Wt is the tth 32 – bit word in the 80-word block. Kt is a constant.
6. Each primitive function takes three 32-bit words as input and produces a 32-bit word
output. Each function performs a set of bitwise logical operations
a) For 0 <= t <= 19, f(t, B, C, D) = (B ^ C) v (~B ^ D) and Kt = 5A827999
b) For 20 <= t <= 39, f(t, B, C, D) = B C D and Kt = 6ED9EBA1
c) For 40 <= t <= 59, f(t, B, C, D) = (B ^ C) v (B ^ D) v (C ^ D) and Kt = 8F1BBCDC
d) For 60 <= t <= 79, f(t, B, C, D) = B C D and Kt = CA62C1D6
7. The result of the last round n=79 is added to the initial values of A, B, C, D, and E to
obtain the 160 (32*5) bit message digest for the block.
Comparison of SHA-1 and MD5:
The two algorithms are compared using their design goals. They are
Security against brute-force attacks: The most important difference is that SHA-1 digest is
32-bits longer than MD5 digest.
Algorithm:
1. Select a large prime number p
2. Select prime number q which is a divisor of (p-1) where 2159<q< 2160
3. Select a number h where 1<h<(p-1)
4. Calculate g = h(p-1)/q mod p such that h(p-1)/q mod p > 1
5. Select a private key which is random number x where 0<x<q
6. Then the public key is y = gx mod p
Per Message Application:
1. Select a random integer k such that 0<k<q
2. Let M be the message to be transmitted
Verification:
*************
Step 2: User enters user id and password: The user enters her id and password and presses
the OK equivalent button. This causes the user id and password to travel in clear text to the
server. This is shown in the following figure:
Step 3: User id and password validation: The server consults the user database to see if this
particular user id and password combination exists there. Usually, this is the job of a user
authenticator program is shown in the following figure. This is a program that takes user id
and password, checks it against user database, and returns the result of the authentication
(success or failure). This is one of the types of checking.
Step 4: User signs the random challenge with message digest of the password
The application displays the password entry screen to the user and the user enters the
password. The application executes the message digest algorithm on this password. The
Step 5: Server verifies the encrypted random challenge received from the user
To verify the encrypted random challenge the server uses one of the following ways:
Password Encryption:
The clear text password is encrypted on the user’s computer and then sends it to the
server for authentication. In the case of Internet applications, the client is a Web browser,
which is not having encryption capability. Consequently, we must resort to technologies such
as Secure Socket Layer (SSL). The SSL creates a secure connection between client and
server. The SSL would perform the required encryption operations. This is shown in the
following figure:
1. Challenge/Response Tokens:
The seed pre-programmed inside an authentication is secret and unique. This fact is
basis for the challenge/response tokens. The seed becomes the encryption key in this
technique.
Step 1: User sends a login request: The user sends the login request only with user id. This
is shown in the following figure:
Step 3: User signs the random challenge with the message digest of the password: The
user gets the following screen. Let us assume that the random challenge sent by the user was
8102811291012.
Step 5: Server returns an appropriate message back to the user: Finally the server sends
an appropriate message (success/failure) to the user. This is shown in the following figure:
Step 3: Server returns an appropriate message back to the user: Finally the server sends
an appropriate message (success/failure) to the user. This is shown in the following figure:
Step 2: Login request: The user send only user id to the server and is shown in the following
figure:
Step 4: User signs the user challenge: The user sings the random number using his/her
private key. The user needs to access private key which is stored on disk of his/her computer.
This is shown in the following figure:
The server uses public key of the user to decrypt the encrypted random number
received from the user. This is shown in the following figure:
Biometric authentication:
These mechanisms are receiving a lot of public attention. A biometric device is
perhaps the ultimate attempt in trying to prove who you are. Biometrics allows a person to be
identified and authenticated based on a set of recognizable and verifiable data, which are
unique and specific to them.
Biometric authentication is the process of comparing data for the person's
characteristics to that person's biometric "template" in order to determine resemblance. The
reference model is first store in a database or a secure portable element like a smart card. The
The above diagram shows the overall architecture, which consists of three main
components:
1. Host agent module: An audit collection module operating as a background process
on a monitored system. Its purpose is to collect data on security-related events on the
host and transmit these to the central manager.
2. LAN monitor agent module: Operates in the same fashion as a host agent module
except that it analyzes LAN traffic and reports the results to the central manager.
3. Central manager module: Receives reports from LAN monitor and host agents and
processes and correlates these reports to detect intrusion.
Malicious Software:
Malicious software is software that is intentionally included or inserted in a system
for a harmful purpose. The following diagram provides classification of software threats or
malicious programs.
When the following program is invoked, control passes to its virus, which performs
the following steps:
a. For each uninfected file P2 that is found, the virus first compresses that file to
produce P'2, which is shorter than the original program by the size of the virus.
b. A copy of the virus is prepended to the compressed program.
c. The compressed version of the original infected program, P'1, is uncompressed.
d. The uncompressed original program is executed.
A Compression Virus
In the above example, the virus does nothing other than propagate. As in the previous
example, the virus may include a logic bomb.
Initial Infection:
Once a virus has gained entry to a system by infecting a single program, it is in a
position to infect some or all other executable files on that system when the infected program
executes. Thus, viral infection can be completely prevented by preventing the virus from
gaining entry in the first place.
Types of Viruses:
The viruses are classified into six types. They are
1. Parasitic virus: The traditional and still most common form of virus. A parasitic
virus attaches itself to executable files and replicates, when the infected program is
executed, by finding other executable files to infect.
2. Memory-resident virus: Lodges in main memory as part of a resident system
program. From that point on, the virus infects every program that executes.
There are the two principles that are used in the Multilevel Security.
1. No Read up: A subject can only read an object of same security level or lower
security level and it ca not read an object at higher level. This property is also known
as Simple Security level. This property is also known as Simple Security Policy.
Here, the Reference Monitor controls the access of objects by the Subjects according
to the security parameters that are defined in the security kernel database. Here, all the access,
no read up & no write down principles are programmed in the security kernel database. The
following are the properties of Reference Monitor.
1. Complete Mediator: The security rules are enforced (applied) to each & every
request.
2. Isolation: The reference monitor and security kernel database must be protected
from unauthorized user. These are under control of administrator.
3. Verifiability: Each and every decision that are taken by the reference monitor is not
changed for a request until kernel database modified.
As the reference monitor is capable of providing verifiability, we call it as a trusted
system. The final element in the reference monitor concept Audit File.
Audit File: The reference monitor keeps all the transactions that are granted or that are stored
in the audit file. It also keeps the information about illegal operations performed by the users
in the audit file. All the security policies that are having some drawbacks are also written in
the audit file. Based on the audit file the administrators may update the kernel database.
Trojan Horse and Defense: Trojan horse attack begins when an illegal user wants to access
the information from a legal users login before him. After a legal user ‘A’ gains access to
system, ‘B’ comes to him and asks to run a file or program in the floppy. The program
internally contains another file called Trojan horse. When the program is executed by the
Let us consider the use of secured Operating System in this scheme. Here, we have to
define security levels for the subjects and objects. Here, we use two important security levels:
They are a) Public b) Sensitive.
Sensitive is higher than Public. Whenever user ‘A” logs in his program, his data
(protected) are given Sensitive security level. All other programs that he will execute, which
are not owned by him are given Public security level. So, user B’s program gets public
security level. Whenever user ‘A’ executes B’s program, it executes, the Trojan Horse
program is also executed. Its job is read information, from the user A which is assigned
Sensitive Security level. We have the principle “No Read up”, in the security Operating
System. So, the Trojan Horse program which is having public security level is not able to
*************
Web page is a document available on World Wide Web. Web Pages are stored on
web server and can be viewed using a web browser. A web page can contain huge
information including text, graphics, audio, video and hyperlinks. These hyperlinks are the
link to other web pages.
Collection of linked web pages on a web server is known as website. There is
unique Uniform Resource Locator (URL) is associated with each web page. Web pages are
classified into three types. They are
1. Static Web Pages: Static web pages are also known as flat or stationary web page. They
are loaded on the client’s browser as exactly they are stored on the web server. Such web
pages contain only static information. User can only read the information but can’t do any
modification or interact with the information. Static web pages are created using only HTML
(Hyper Text Markup Language). Static web pages are only used when the information is no
more required to be modified. This is explained in the following figures:
2. Dynamic Web Pages: Dynamic web page shows different information at different point
of time. It is possible to change a portion of a web page without loading the entire web page.
It has been made possible using Ajax (Asynchronous JavaScript and XML) technology.
This is shown in the following figure. Dynamic web pages are classified into two types. They
are:
a. Server-Side Dynamic Web Page: It is created by using server-side scripting. There are
server-side scripting parameters that determine how to assemble a new web page which also
includes setting up of more client-side processing.
b. Client-Side Dynamic Web Page: It is processed using client side scripting such as
JavaScript and then passed in to Document Object Model (DOM).
1. The Physical Layer is made from the actual hardware (cables, network interface cards
etc.,) and the drivers which are required to run that hardware.
2. The Application Layer represents the application which we are running. In our case
the application is the WEB and the application layer is HTTP (Hyper Text Transfer
Protocol).
SSL is designed to make use of TCP to provide reliable service. It is not a single
protocol. It consists two layers of protocol as shown in the following figure:
At the receiving end SSL record protocol performs remove header part, decrypt,
verifies MAC values, and optionally decompresses to get a fragment. Such fragments are
reassembled to get the message & it is delivered to the end user.
Step 2: Timestamping request: Now, the client sends the message digest calculated in the
step 1 to the Time Stamp Authority (TSA) for getting a Timestamped and is known as Time
Stamping Request. This is shown in the following figure:
Step 3: Time stamping response: In response to the client’s request, The TSA might decide
to grant or reject the timestamp. If it decides to accept the request and process it, it signs the
client’s request together with the timestamp by the TSA private key. Regardless, it returns a
Time Stamping Response back to the client. This is shown in the following figure:
The above Figure indicates the participants in the SET system, which include the
following:
1. Cardholder: In the electronic environment, consumers and corporate purchasers
interact with merchants from personal computers over the Internet. A cardholder is an
authorized holder of a payment card (e.g., MasterCard, Visa) that has been issued by
an issuer.
2. Merchant: A merchant is a person or organization that has goods or services to sell to
the cardholder. Typically, these goods and services are offered via a Web site or by
electronic mail. A merchant that accepts payment cards must have a relationship with
an acquirer.
Secure Protocol:
3-D Secure is an XML-based protocol designed to be an additional security layer for
online credit and debit card transactions. It was originally developed by Arcot Systems (now
Certificate Authority (CA) Technologies) and first deployed by Visa with the intention of
improving the security of Internet payments and is offered to customers under the name
Verified by Visa.
The main difference between SET and 3-D Secure is that any cardholder who wishes
to participate in a payment transaction involving the use of the 3-D secure protocol has to
enroll on the issuer bank’s Enrollment Server. That is, the cardholder makes a card payment;
Step 2: The user will be redirected to issuer’s bank site and enters the password given by the
bank. This is shown in the following figure:
Step 2: The customer receives the money and decrypts it. This is shown in the following
figure:
2. Anonymous electronic money: This type of money is also called blinded money works
like real hard cash. There is no more trace of how money was spent. The bank cannot create
any serial number like in Identified electronic money. But the customer creates the serial
number. The process of the customer generating random number is as follows:
i. The customer generates a random number by some mathematical algorithm. The
customer then multiplies it by another huge number (called as the blinding factor).
ii. The customer sends the resulting number, called as blinded number to the bank.
iii. The bank does not know about the original number of Step (i).
iv. Bank signs (i.e. encrypts) the blinded number and sends it back to the customer.
II. Classification Based on the Involvement of the Bank in the Transaction: Based on the
involvement of the bank in the actual transaction electronic money can be further classified
into two categories. They are
1. Online electronic money: In this type, the bank must actively participate in the transaction
between the customer and the merchant. That is, before purchase transaction of the customer
can complete, the merchant would confirm from the bank in real time as to whether the
electronic money offered by the customer is acceptable (e.g. ensuring that it is not already
spent, or that the serial number for it is valid).
2. Offline electronic money: In this type, the bank does not participate in the transaction
between the customer and the merchant. That is, the customer purchases something from the
merchant and offers to pay by electronic money. The merchant accepts the electronic money,
[INFORMATION SECURITY AND CRYPTOGRAPHY NOTES(K.G.R.L P.G COLLEGE]
but does not validate it online. The merchant might collect a group of such electronic money
transactions and process them together at a fixed time every day.
The Double Spending Problem:
If we combine the two ways of classifying electronic money, we have four
possibilities:
1. Identified online electronic money
2. Identified offline electronic money
3. Anonymous online electronic money
4. Anonymous offline electronic money
Of the four, the last type can create the double spending problem. A customer could
arrange for anonymous electronic money by using the blinded money concept. Later on, he
could spend it offline more than once in quick succession (say in the same hour) with to
different merchants. Since the bank is not involved in any of the two online transactions, the
fact that same price of money is being spent cannot be prevented. Moreover, when it is
realized that the same piece of money is spent more than once (when both merchants send
their daily transaction lists to the bank), the bank cannot determine which customer spent it
more than once, because of the blinding factor. Consequently, anonymous offline electronic
money is of little practical use.
Double spending problem can happen in case of identified offline electronic money as
well. However, upon detection, the customer under question can be easily tracked from the
serial numbers of the electronic money. This is shown in the following figure:
Simple Mail Transfer Protocol (SMTP): SMTP (Simple Mail Transfer Protocol) is a
TCP/IP protocol used in sending and receiving e-mail. However, since it is limited in its
ability to queue messages at the receiving end. The following figure shows Email using the
SMTP protocol:
In case of a message in ENCRYPTED mode, Alice first has to decrypt the message
from Fred and re-encrypt it with Bob‘s key.
PEM Certification Authority Hierarchy:
Each PCA has to enforce a policy from one of three possible security levels:
1. High Assurance (HA): super-secure, i.e. implemented on special hardware, tamper
resistant, etc.
2. Discretionary Assurance (DA): well managed at top level, but does not impose any
rules on the organizations to which CA certificates are granted
3. No Assurance (NA): only constraint: not allowed to issue two certificates with same
name
PRETTY GOOD PRIVACY (PGP):
Pretty Good Privacy (PGP) is high-security cryptographic software application, which
allows people to exchange messages or file with privacy (confidentially), authentication and
integrity. PGP can also be used to encrypt and apply digital signature for e-mail, PGP was
developed by Zimmermann in the 1980s and first version was released on Internet in 1991.
Because of legal issues for usage of RSA, it was purchased by Via-Crypt and RSA licensed
company in 1993 and released again in 1994.
There are number of reasons that make the PGP to use widely. Some of them are:
1. PGP is freeware, but also commercial versions available.
2. Operating system independent and run on Windows/Unix/Macintosh etc.
3. Used popular and standard algorithms like RSA, DSS, IDEA
4. Wide range of applications.
5. One of the major reasons is it was not controlled by any governmental or
standard organization.
Authentication: The following diagram shows the authentication provision by using digital
structure:
The above said scheme is called as digital signature scheme. Steps involved in the
above diagram explained as follows:
1. At source machine, message is created.
2. Generation of 160-bit hash code of message by using SHA-1.
3. RSA algorithm is used for encrypting hash code; sender’s private key is used for
encryption so that authentication is provided. This hash code is used to the
message.
4. Receiver decrypts the message by using public key of sender and recovers the
hash code.
5. Now receiver generates hash code for the message and compares it with the
decrypted hash code, if both are same then the message is authenticated.
The security layer of WAP stack is also called Wireless Transport Layer Security
(WTLS) protocol. It is an optional layer, that when present, provides features such as
authentication, privacy and secure connections – as required by many e-commerce and m-
commerce (Mobile Commerce) applications. WTLS ensures the following four things:
1. Privacy ensures that the message passing between the client and the server are not
accessible to anybody else.
The process begins with a challenge-response mechanism. The network sends a 128-
bit random number to the subscriber when authentication begins. After this, 32-bit signed
response using the authentication algorithm (A3) and the subscriber authentication key (Ki) is
prepared by the handset and sent back to the network. The network retrieves its value of Ki
from its database, performs the same operation using the A3 algorithm on the original 128-bit
random number and compares this result with the one received from the handset. If the two
match, the user is considered as successfully authenticated. Since the calculation of the
signed response takes place inside the SIM, the IMSI or Ki never have to leave the SIM. That
makes authentication secure.
[INFORMATION SECURITY AND CRYPTOGRAPHY NOTES(K.G.R.L P.G COLLEGE]
Signaling and Data Confidentiality: The SIM contains the ciphering key generation
algorithm (A8). This is used to produce the 64-bit ciphering key (Kc).The value of Kc is
obtained by applying the same random number as used in authentication to the A8 algorithm
with the individual subscriber authentication key (Ki). This key (Kc) is later used for secure
communications between the subscriber and the mobile telephony base station. This process
is shown in the following figure:
Voice and Data Security: The A5 algorithm is used to encrypt the voice and data traffic
between the user’s handset and the GSM network. For this, the subscriber’s handset sends a
ciphering mode request to the GSM network. The network, in response, starts encryption and
decryption of the traffic using ciphering algorithm (A5) and the ciphering key (Kc).
Note: The algorithms A3, A5, A8 are kept secret and are not available to the general public.
However, they have been discovered, published on the Internet, and their implementations in
C and other programming languages are available in many books/resources.
Explanation:
1. Version - currently has the value 4
2. Header length - the number of 32-bit words in the header
i. because this is 4 bits, the max header length is 15 words (i.e. 60 bytes)
ii. the header is at least 20 bytes, but options may make it bigger
3. Type of Service - contains a 3-bit precedence field (that is ignored today), 4 service
bits, and 1 unused bit.
i. The four service bits can be:
ii. 1000 - minimize delay
iii. 0100 - maximize throughput
iv. 0010 - maximize reliability
v. 0001 - minimize monetary cost
ii. This is a "hint" of what characteristics of the physical layer to use
iii. The Type of Service is not supported in most implementations. However,
some implementations have extra fields in the routing table to indicate delay,
throughput, reliability, and monitory cost.
4. Total Length - specified in bytes.
i. we know where the data starts by the header length
ii. we know the size of the data by computing "total length - header length"
IP Security Issues:
1. Eavesdropping
2. Modification of packets in transit
3. Identity spoofing (forged source IP addresses)
4. Denial of service
5. Many solutions are application-specific: TLS ( Transport Layer Security ) for Web,
S/MIME ( Secure / Multipurpose Internet Mail Extension ) for email, SSH ( Secure
Shell ) for remote login
6. IPSec aims to provide a framework of open standards for secure communications over
IP
7. Protect every protocol running on top of IPv4 and IPv6
a. SPI & sequence number – Same as for AH. We can get these from SA database.
b. IV – Initialization Vector which is used in the cryptographic encryption algorithm
such as CBC.
c. data – It is protected data, probably encrypted.
d. padding – Padding is used for several reasons: to make the data multiple of block size
for cryptographic algorithm that require it.
e. padding length – Number of octets of padding.
f. next header – Same as in AH.
g. authentication data – Same as AH. It is zero length if ESP is providing encryption.
4. Transport and Tunnel Mode: There are two types of modes in IP Security. They are
a. Transport Mode – It provides protection for upper layer protocols in the IP packet. In
this mode, the IP Security information is placed between the IP Header and rest of the
data.
b. Tunnel Mode – It provides protection to the entire IP packet. In this mode, IP Security
information is appended to the original packet with a new header and IP Security
information.
This is explained in the following figure:
The organization packet from user ‘A’ must pass through F1-Internet-F2 to reach ‘B’.
The firewall F1will attaches the secured information to the organization packet in the
following way using Tunnel mode.
In this way, Transport and Tunnel modes are used while communicating between two
ends.
IPsec:IKE:
The Internet Key Exchange (IKE) is a protocol designed to create both inbound and
outbound Security Associations (SAs) i.e., IKE creates SAs for IP Security.
Components of IKE:
The following diagram shows the components of IKE.
1. The Oakley protocol was developed by Hilarie Orman. It is a key creation protocol
based on the Diffie-Hellman key-exchange method.
Phase 1:
In phase 1, it can do the following things:
1. Does authenticated DH, establishes session key & “ISAKMP SA”
2. There are two possible modes in Phase 1: Main & Aggressive
3. The following two keys are derived from the session key:
a. SKEYID_e: to encrypt Phase 2 messages
b. SKEYID_a: to authenticate Phase 2 messages
Phase 2:
In Phase 2, it can do the following things:
a. IPsec SA & session key established; messages encrypted & authenticated with Phase
1 keys.
b. Additional DH exchange is optional (for PFS).
We have shown two networks, Network 1 and Network 2. Network 1 connects to the
Internet via a firewall named Firewall 1. Similarly, Network 2 connects to the Internet with
its own firewall, Firewall 2. The two firewalls are virtually connected to each other via the
Internet. We have shown this with the help of a VPN tunnel between the two firewalls.
With this configuration, let us understand how VPN protects the traffic passing
between any two hosts on the two different networks. For this, let us assume that host X on
Network 1 wants to send a data packet to host Y on Network2. This transmission would work
as follows:
2. The packet reaches Firewall 1. Now Firewall 1 adds new headers to the packet. In these
new headers, it changes the source IP address of the packet from that of host X to its own the
IP address (i.e. the IP address of Firewall 1, say F1 ). It also changes the destination IP address
of the packet from that of host Y to the IP address of Firewall 2, say F 2). This is show in the
following figure. It also performs the packet encryption and authentication, depending on the
settings and sends the modified packet over the Internet.
3. The packet reaches Firewall 2 over the Internet, via one or more routers, as usual. Firewall 2
discards the outer header and performs the appropriate decryption and other cryptographic
functions as necessary. This yields the original packet, as was created by host X in Step 1.
This is shown in the following figure. It then takes a look at the plain text contents of the
packet and realizes the packet is meant for host Y (because the destination address inside the
packet specific host Y). Therefore, it delivers the packet to host Y.
*************