Cryptography and Network Security
Cryptography and Network Security
Mrs. N Supriya
Assistant Professor
Department of CSE, AITS
CNS
UNIT-1
SECURITY CONCEPTS
INTRODUCTION
Basic Concepts
Plaintext can refer to anything which humans can understand and/or relate to.
This may be as simple as English sentences, a script, or Java code. If you can
make sense of what is written, then it is in plaintext.
1. Encryption
2. Authentication
3. Integrity
Now, one problem that a communication system can face is the loss of integrity
of messages being sent from sender to receiver. This means that Cryptography
should ensure that the messages that are received by the receiver are not
altered anywhere on the communication path. This can be achieved by using the
concept of cryptographic hash.
4. Non Repudiation
Types of Cryptography
This type of cryptography technique uses just a single key. The sender applies a
key to encrypt a message while the receiver applies the same key to decrypt the
message. Since only single key is used so we say that this is a symmetric
encryption.
The biggest problem with this technique is the distribution of key as this
algorithm makes use of single key for encryption or decryption.
This type of cryptography technique involves two key crypto system in which a
secure communication can take place between receiver and sender over insecure
communication channel. Since a pair of keys is applied here so this technique is
also known as asymmetric encryption.
This is what we use when we setup public key authentication in openssh to login
from one server to another server in the backend without having to enter the
password.
3. Hash Functions
This technique does not involve any key. Rather it uses a fixed length hash value
that is computed on the basis of the plain text message. Hash functions are used
to check the integrity of the message to ensure that the message has not be
altered,compromised or affected by virus.
The decision maker in organizations must set policy and operates their
organization in compliance with the complex, shifting legislation, efficient
and capable applications.
Data in the organization can be in two forms are either in rest or in motion,
the motion of data signifies that data is currently used or processed by
the system. The values of the data motivated the attackers to steal or
corrupts the data. This is essential for the integrity and the values of the
organization’s data. Information security ensures the protection of both
data in motion as well as data in rest.
The organization must add intrastate services based on the size and scope
of the organization. Organizational growth could lead to the need for public
key infrastructure, PKI an integrated system of the software, encryption
methodologies. The information security mechanism used by large
organizations is complex in comparison to a small organization. The small
organization generally prefers symmetric key encryption of data.
SECURITY APPROACHES
1. Trusted Systems:
Trusted systems were initially of primary interest to the military. However, these
days, the concept hasspanned across various areas, most prominently in the
banking and financial community, but the conceptnever caught on. Trusted
systems often use the term reference monitor.
2. Security Models
Good security management practices always talk of a security policy being in place.
Putting a securitypolicy in place is actually quite tough.
PRINCIPLES OF SECURITY
Loss of confidentiality
Another user C gets access to this message, which is not desired andtherefore,
defeats the purpose of confidentiality. Example of this could be a confidential
email messagesent by A to B, which is accessed by C without the permission or
knowledge of A and B. This type ofattack is called as interception.
Interception causes loss of message confidentiality.
2. Authentication
Authentication mechanisms help establish proof of identities. The authentication
process ensures thatthe origin of a electronic message or document is correctly
identified.
suppose that user Csends an electronic document over the Internet to user B.
However, the trouble is that user C had posedas user A when she sent this
document to user B.
A real life example of this could be the case of a user C, posing asuser A, sending
a funds transfer request (from A’s account to C’s account) to bank B. The bank
mighthappily transfer the funds from A’s account to C’s account – after all, it
would think that user A hasrequested for the funds transfer! This concept is
shown in Fig.
Loss of integrity
4. Non-repudiation
There are situations where a user sends a message and later on refuses that she
had sent that message. Forinstance, user A could send a funds transfer request
to bank B over the Internet. After the bank performsthe funds transfer as per
A’s instructions, A could claim that she never sent the funds transfer
instructionto the bank! Thus, A repudiates or denies, her funds transfer
instruction. The principle of non-repudiation defeats such possibilities of denying
something, having done it. This is shown in Fig.
Attack on availability
TYPES OF SECURITY ATTACKS
We shall classify attacks with respect to two views: the common person’s view
and a technologist’s view.
1. General Attacks:
A General ViewFrom a common person’s point of view, we can classify
attacks into three categories, as shown inFig.
Legal Attacks This form of attack is quite novel and unique. Here, the attacker
tries to make the judgeor the jury doubtful about the security of a computer
system. This works as follows. The attacker attacksthe computer system and the
attacked party (say a bank or an organization) manages to take the attacker
to the court.
Active attacks
Masquerade is caused when an unauthorized entity pretends to be another entity.
Replay attack, a user captures a sequence of events or some data units and re-
sends them.
Alteration of messages involves some change to the original message. For
instance, suppose user Asends an electronic message Transfer $1000 to D’s
account to bank B. User C might capture this andchange it to Transfer $10000
to C’s account.
Virus
A virus is a computer program that attaches itself to another legitimate program
and causes damageto the computer system or to the network.
During its lifetime, a virus goes through four phases:
(a) Dormant phase: Here, the virus is idle. It gets activated based on certain
action or event (e.g. theuser typing a certain key or certain date or time is
reached, etc). This is an optional phase.
(b) Propagation phase: In this phase, a virus copies itself and each copy starts
creating more copies ofself, thus propagating the virus.
(c) Triggering phase: A dormant virus moves into this phase when the
action/event for which it waswaiting is initiated.
(d) Execution phase: This is the actual work of the virus, which could be harmless
(display somemessage on the screen) or destructive (delete a file on the disk).
Trojan horse
4. Specific Attacks
SECURITY SERVICES
SECURITY MECHANISMS
1. Encipherment :
This security mechanism deals with hiding and covering of data which helps
data to become confidential. It is achieved by applying mathematical
calculations or algorithms which reconstruct information into not readable
form. It is achieved by two famous techniques named Cryptography and
Encipherment. Level of data encryption is dependent on the algorithm used
for encipherment.
2. Access Control :
This mechanism is used to stop unattended access to data which you are
sending. It can be achieved by various techniques such as applying
passwords, using firewall, or just by adding PIN to data.
3. Notarization :
4. Data Integrity :
5. Authentication exchange :
6. Bit stuffing :
This security mechanism is used to add some extra bits into data which is
being transmitted. It helps data to be checked at the receiving end and is
achieved by Even parity or Odd Parity.
7. Digital Signature :
INTRODUCTION:
Cryptographic system
Cryptanalysis
Cryptology is a combination of cryptography and cryptanalysis.
A N N A M A C H A R Y A
D Q Q D P D F K D U B D
Each alphabet in the original message can be replaced by another to hidethe
original contents of the message. The codified message is called as cipher text.
Cipher means a codeor a secret message.
When a plain text message is codified using any suitable scheme, the resulting
message iscalled as cipher text.
SUBSTITUTION TECHNIQUES
1. CAESAR CIPHER
This was first proposed by Julius Caesar and is termed as Caesar Cipher.
Caesar Cipher is a special case of substitution techniques wherein eachalphabet
in a message is replaced by an alphabet three places down the line. For instance,
using theCaesar Cipher, the plain text ATUL will become cipher text DWXO.
MONO-ALPHABETIC CIPHER
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
samba
the Cipher text is : HOSKO
Homophonic Substitution Cipher
For example, ‘a’ can be enciphered as ‘d’ in the starting of the text, but as ‘n’ at
the middle. The polyalphabetic ciphers have the benefit of hiding the letter
frequency of the basic language. Therefore attacker cannot use individual letter
frequency static to divide the ciphertext.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Key: samba
Plain text: hello students how are you
Cipher text:
Key s a m B a s a m b a s a m b a s a m b a s A
PT h e l L o s t u d e n t s h o w a r e y o U
CT z e x M o k t g E e f t e i o o a c f y g U
Playfair Cipher:
The Playfair Cipher, also called as Playfair Square, is a cryptographic technique
that is used formanual encryption of data.
The Playfair encryption scheme uses two main processes, as shown in Fig
1. Enter the keyword in the matrix row-wise: left-to-right, and then top-to-
bottom.
2. Drop duplicate letters.
3. Fill the remaining spaces in the matrix with the rest of the English alphabets
(A-Z)that were not a part of our keyword. While doing so, combine I and J in the
same cell of the table. In otherwords, if I or J is a part of the keyword, disregard
both I and J while filling the remaining slots.
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'
1. Pair cannot be made with same letter. Break the letter in single and add a
bogus letter to the previous letter.
Plain Text: “hello”
After Split: ‘he’ ‘lx’ ‘lo’
Here ‘x’ is the bogus letter.
2. If the letter is standing alone in the process of pairing, then add an extra
bogus letter with the alone letter
Plain Text: “helloe”
AfterSplit: ‘he’ ‘lx’ ‘lo’ ‘ez’
• If both the letters are in the same column: Take the letter below each
one (going back to the top if at the bottom).
For example:
Diagraph: "me"
Encrypted Text: cl
Encryption:
m -> c
e -> l
If both the letters are in the same row: Take the letter to the right of each
one (going back to the leftmost if at the rightmost position).
Diagraph: "ST"
Encrypted Text: TL
Encryption:
S -> T
T -> L
If neither of the above rules is true: Form a rectangle with the two letters
and take the letters on the horizontal opposite corner of the rectangle.
For example:
Diagraph: "nt"
Encrypted Text:rq
Encryption:
n -> r
t -> q
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
Rail fence technique involves writing plain text as sequence of diagonals and then
reading itrow-by-row to produce cipher text.
Suppose that we have a plain textmessage Come home tomorrow. How would we
transform that into a cipher text message using the RailFence Technique? This
is shown in Fig.
The Simple Columnar Transposition Technique simply arranges the plain text as
a sequenceof rows of a rectangle that are read in columns randomly.
The general model shows that there are four basic tasks in designing a particular
securityservice:
1. Design an algorithm for performing the security-related transformation.
Thealgorithm should be such that an opponent cannot defeat its purpose.
2. Generate the secret information to be used with the algorithm .
3. Develop methods for the distribution and sharing of the secret
information.
4. Specify a protocol to be used by the two principals that makes use of the
securityalgorithm and the secret information to achieve a particular
security service
A general model is illustrated by the above Figure 1.6, which reflects a concern
forprotecting an information system from unwanted access. Most readers are
The process of encoding plain text messagesinto cipher text messages is called
as encryption.
The process of transforming cipher textmessages back to plain text messages is
called asdecryption.
Every encryption and decryption process has two aspects: the algorithm and the
key used forencryption and decryption.
let us take the example ofa combination lock, which we use in real life. We need
to remember the combination (which is a number, suchas 871) needed to open up
the lock. The facts that it is acombination lock and how to open it (algorithm)
arepieces of public knowledge. However, the actual valueof the key required for
opening a specific lock (key),which is 871 in this case, is kept secret. The idea
isillustrated in Fig
The sender andthe receiver will use the same key to lock and unlock, this is called
as symmetric key operation (whenused in the context of cryptography, this
operation is called as symmetric key cryptography).
Person A wants to send a highly confidential letter to another person B. A and B
both residein the same city, but are separated by a few miles and for some
reason, cannot meet eachother.
With the symmetric key cryptography A can send securely to the B.
Let us now imagine that not only A and B but also thousands of people want to
send such confidentialletters securely to each other. What would happen if they
decide to go for symmetric key operation? Ifwe examine this approach more
closely, we can see that it has one big drawback if the number of peoplethat want
to avail of its services is very large.
Therefore, can we see that, in general, for n persons, the number of lock-and-key
𝑛∗(𝑛−1)
pairs is
2
In this scheme the two parties, who want to communicatesecurely, can agree on
a symmetric key using this technique. This key can then be used for encryption/
decryption. However, we must note that Diffie–Hellman key exchange algorithm
can be used only forkey agreement, but not for encryption or decryption of
messages. Once both the parties agree on the keyto be used, they need to use
other symmetric key encryption algorithms for actual encryption or decryption
of messages.
In this scheme, (Alice) A and (Bob) B do not have to jointly approach (Tom) T for
a lock-and-key pair. Instead, B aloneapproaches T, obtains a lock and a key (K1)
that can seal the lock and sends the lock and key K1 to A. Btells A that A can use
that lock and key to seal the box before sending the sealed box to B.
The sender usedmethods such as invisible ink, tiny pin punctures on specific
characters, minute variations betweenhandwritten characters, pencil marks on
handwritten characters, etc.
Brute forceattack
With every incremental bit, the attacker has to perform double the number of
operations ascompared to the previous key size. It is found that for a 56-bit key,
We can represent the possible values in the key range using hexadecimal notation
and see visuallyhow an increase in the key size increases the key range and
therefore, the complexity for an attacker.
Known plain text attack: In this case, the attacker knows about some pairs of
plain text andcorresponding cipher text for those pairs. Using this information,
the attacker tries to find otherpairs and therefore, know more and more of the
plain text. Examples of such known plain texts arecompany banners, file headers,
etc. which are found commonly in all the documents of a particularcompany.
Chosen plain text attack: Here, the attacker selects a plain text block and tries
to look for theencryption of the same in the cipher text. Here, the attacker is
able to choose the messages toencrypt. Based on this, the attacker intentionally
Chosen cipher text attack: In the chosen cipher text attack, the attacker knows
the cipher text tobe decrypted, the encryption algorithm that was used to
produce this cipher text and thecorresponding plain text block. The attacker’s
job is to discover the key used for encryption.
A stream cipher is one that encrypts a digital data stream one bit or one byte at
a time.
Examples of classical stream ciphers are the autokeyed Vigenère cipher and the
Vernam cipher.
In the ideal case, a one-time pad version of the Vernam cipher wouldbe used, in
which the keystream (Ki) is as long as the plaintext bit stream (Pi). If the
cryptographic keystream is random, then this cipher is unbreakable by anymeans
other than acquiring the keystream.
The logic of a general substitution cipher for A 4-bit input produces one of 16
possible input states, which is mapped by thesubstitution cipher into a unique one
of 16 possible output states, each of which isrepresented by 4 ciphertext bits.
A block cipher is designed by considering its three critical aspects which are
listed as below:
1. Number of Rounds
2. Design of Function F
3. Key Schedule Algorithm
1. Number of Rounds
The number of rounds judges the strength of the block cipher algorithm. It is
considered that more is the number of rounds, difficult is for cryptanalysis to
break the algorithm.
2. Design of Function F
The function F of the block cipher must be designed such that it must be
impossible for any cryptanalysis to unscramble the substitution. The criterion
that strengthens the function F is it non-linearity.
More the function F is nonlinear, more it would be difficult to crack it. Well, while
designing the function F it should be confirmed that it has a good avalanche
property which states that a change in one-bit of input must reflect the change
in many bits of output.
It is suggested that the key schedule should confirm the strict avalanche effect
and bit independence criterion.
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 −
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
There are a total of eight S-box tables. The output of all eight s-boxes is
then combined in to 32 bit section.
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
AES does not use a Feistel structure. Instead, each full round consists offour
separate functions: byte substitution, permutation, arithmetic operations over a
finite field, and XOR with a key.
General Structure
Figure shows the overall structure of the AES encryption process. The cipher
takes a plaintext block size of 128 bits, or 16 bytes. The key length can be 16,
24, or 32bytes (128, 192, or 256 bits). The algorithm is referred to as AES-128,
AES-192, orAES-256, depending on the key length.
Operation of AES
Interestingly, AES performs all its computations on bytes rather than bits.
Hence, AES treats the 128 bits of a plaintext block as 16 bytes. These 16 bytes
are arranged in four columns and four rows for processing as a matrix −
Unlike DES, the number of rounds in AES is variable and depends on the length
of the key. AES uses 10 rounds for 128-bit keys, 12 rounds for 192-bit keys and
14 rounds for 256-bit keys. Each of these rounds uses a different 128-bit round
key, which is calculated from the original AES key.
Encryption Process
The 16 input bytes are substituted by looking up a fixed table (S-box) given in
design. The result is in a matrix of four rows and four columns.
Shiftrows
Each of the four rows of the matrix is shifted to the left. Any entries that ‘fall
off’ are re-inserted on the right side of row. Shift is carried out as follows −
[ b0 | b1 | b2 | b3 ] [ b0 | b1 | b2 | b3 ]
| b4 | b5 | b6 | b7 | -> | b5 | b6 | b7 | b4 |
| b8 | b9 | b10 | b11 | | b10 | b11 | b8 | b9 |
[ b12 | b13 | b14 | b15 ] [ b15 | b12 | b13 | b14 ]
MixColumns
[ c0 ] [ 2 3 1 1 ] [ b0 ]
| c1 | = | 1 2 3 1 || b1 |
| c2 | | 1 1 2 3 || b2 |
[ c3 ] [ 3 1 1 2 ][ b3 ]
The 16 bytes of the matrix are now considered as 128 bits and are XORed to the
128 bits of the round key. If this is the last round then the output is the
ciphertext. Otherwise, the resulting 128 bits are interpreted as 16 bytes and we
begin another similar round.
Decryption Process
Since sub-processes in each round are in reverse manner, unlike for a Feistel
Cipher, the encryption and decryption algorithms needs to be separately
implemented, although they are very closely related.
BLOWFISH ALGORITHM
1. blockSize: 64-bits
2. keySize: 32-bits to 448-bits variable size
3. number of subkeys: 18 [P-array]
4. number of rounds: 16
5. number of substitution boxes: 4 [each having 512 entries of 32-bits each]
The resultant P-array holds 18 subkeys that is used during the entire
encryption process
Step3: Encryption:
A block cipher processes the data blocks of fixed size. Usually, the size of a
message is larger than the block size. Hence, the long message is divided into a
series of sequential message blocks, and the cipher operates on these blocks one
at a time.
This mode is a most straightforward way of processing a series of sequentially listed message
blocks.
Operation
• The user takes the first block of plaintext and encrypts it with the key
to produce the first block of ciphertext.
• He then takes the second block of plaintext and follows the same process
with same key and so on so forth.
In fact, for a given key technically we can create a codebook of ciphertexts for
all possible plaintext blocks. Encryption would then entail only looking up for
required plaintext and select the corresponding ciphertext. Thus, the operation
is analogous to the assignment of code words in a codebook, and hence gets an
official name − Electronic Codebook mode of operation (ECB). It is illustrated as
follows
In reality, any application data usually have partial information which can be
guessed. For example, the range of salary can be guessed. A ciphertext from ECB
can allow an attacker to guess the plaintext by trial-and-error if the plaintext
message is within predictable.
For example, if a ciphertext from the ECB mode is known to encrypt a salary
figure, then a small number of trials will allow an attacker to recover the figure.
In general, we do not wish to use a deterministic cipher, and hence the ECB mode
should not be used in most applications.
Operation
The operation of CBC mode is depicted in the following illustration. The steps
are as follows −
In CBC mode, the current plaintext block is added to the previous ciphertext
block, and then the result is encrypted with the key. Decryption is thus the
reverse process, which involves decrypting the current ciphertext and then
adding the previous ciphertext block to the result.
It is worth mentioning that CBC mode forms the basis for a well-known data origin
authentication mechanism. Thus, it has an advantage for those applications that
require both symmetric encryption and data origin authentication.
In this mode, each ciphertext block gets ‘fed back’ into the encryption process
in order to encrypt the next plaintext block.
Operation
The operation of CFB mode is depicted in the following illustration. For example,
in the present system, a message block has a size ‘s’ bits where 1 < s < n. The CFB
mode requires an initialization vector (IV) as the initial random n-bit input block.
The IV need not be secret. Steps of operation are –
CFB mode differs significantly from ECB mode, the ciphertext corresponding to
a given plaintext block depends not just on that plaintext block and the key, but
also on the previous ciphertext block. In other words, the ciphertext block is
dependent of message.
CFB has a very strange feature. In this mode, user decrypts the ciphertext using
only the encryption process of the block cipher. The decryption algorithm of the
underlying block cipher is never used.
Apparently, CFB mode is converting a block cipher into a type of stream cipher.
The encryption algorithm is used as a key-stream generator to produce key-
stream that is placed in the bottom register. This key stream is then XORed with
the plaintext as in case of stream cipher.
By converting a block cipher into a stream cipher, CFB mode provides some of the
advantageous properties of a stream cipher while retaining the advantageous
properties of a block cipher.
It involves feeding the successive output blocks from the underlying block cipher
back to it. These feedback blocks provide string of bits to feed the encryption
algorithm which act as the key-stream generator as in case of CFB mode.
The key stream generated is XOR-ed with the plaintext blocks. The OFB mode
requires an IV as the initial random n-bit input block. The IV need not be secret.
Operation
Both encryption and decryption in CTR mode are depicted in the following
illustration. Steps in operation are −
• Load the initial counter value in the top register is the same for both the
sender and the receiver. It plays the same role as the IV in CFB (and CBC)
mode.
• Encrypt the contents of the counter with the key and place the result in
the bottom register.
STREAM CIPHERS
A typical stream cipher encrypts plaintext one byte at a time, although a stream
cipher may be designed to operate on one bit at a time or on units larger than a
byteat a time. A key is input to a pseudorandom bit generator that produces a
stream of8-bit numbers that are apparently random. The output of the generator,
called akeystream, is combined one byte at a time with the plaintext stream using
the bit-wise exclusive-OR (XOR) operation. For example, if the next byte
generated by thegenerator is 01101100 and the next plaintext byte is 11001100,
then the resultingciphertext byte is
RC4
RC4 is a stream cipher designed in 1987 by Ron Rivest for RSA Security. It is a
variable key size stream cipher with byte-oriented operations. The algorithm is
based onthe use of a random permutation. Analysis shows that the period of the
cipher is overwhelmingly likely to be greater than 10100. Eight to sixteen machine
operations are required per output byte, and the cipher can be expected to run
veryquickly in software. RC4 is used in the Secure Sockets Layer/Transport Layer
Security(SSL/TLS) standards that have been defined for communication
between Webbrowsers and servers.
The RC4 algorithm is remarkably simple and quite easy to explain. A variable
length key of from 1 to 256 bytes (8 to 2048 bits) is used to initialize a 256-
bytestate vector S, with elementsS[0],S[1],S[2],. . . . . S[255].
Initialization of S
To begin, the entries are set equal to the values from 0 through 255 in
ascendingorder; that is, S[0],S[1],S[2],. . . . . S[255]=255.
Stream Generation
Once the S vector is initialized, the input key is no longer used. Stream
generationinvolves cycling through all the elements of S[i] , and for each S[i],
swapping S[i] withanother byte in S according to a scheme dictated by the
current configuration of S.After S[255]is reached, the process continues,
starting over again at S[0].
/* Stream Generation */
i, j = 0;
while (true)
i = (i + 1) mod 256;
j = (j + S[i]) mod 256;
Swap (S[i], S[j]);
t = (S[i] + S[j]) mod 256;
k = S[t];
The most powerful and most common approach to securing the points of
vulnerability highlighted in the preceding section is encryption. If encryption is
to be used to counter these attacks, then we need to decide what to encrypt and
The second problem that Diffie pondered, and one that was apparentlyunrelated
to the first, was that of digital signatures.
A public key encryption scheme has the following ingredients which are as follows
1. Each user generates a pair of keys to be used for the encryption and decryption
of messages.
2. Each user places one of the two keys in a public register or other accessible
file. This is the public key.The companion key is kept private. As in Figure
suggests, each user maintains a collection of public keys obtained from others.
4. When Alice receives the message, she decrypts it using her private key. No
other recipient can decrypt the message because only Alice knows Alice’sprivate
key.
• The computation of the pair of keys i.e. private key and the public key must
be easy.
• Knowing the encryption algorithm and public key of the intended receiver,
computation of cipher text must be easy.
• For a receiver of the message, it should be computationally easy to decrypt
the obtained cipher text using his private key.
• It is also required that any opponent in the network knowing the public key
should be unable to determine its corresponding private key.
• Having the cipher text and public key an opponent should be unable to
determine the original message.
RSA ALGORITHM
In this algorithm two keys were used. One is private key and another one is public
key.
In this scheme the two parties, who want to communicatesecurely, can agree on
a symmetric key using this technique. This key can then be used for encryption/
decryption. However, we must note that Diffie–Hellman key exchange algorithm
can be used only forkey agreement, but not for encryption or decryption of
messages. Once both the parties agree on the keyto be used, they need to use
other symmetric key encryption algorithms for actual encryption or decryption
of messages.
1. Key generation
2. Encryption
3. Decryption
It is not necessary to limit the key distribution function to a single KDC. Indeed,
forvery large networks, it may not be practical to do so. As an alternative, a
hierarchy ofKDCs can be established. For example, there can be local KDCs, each
responsiblefor a small domain of the overall internetwork, such as a single LAN
or a singlebuilding.
The more frequently session keys are exchanged, the more secure they are,
becausethe opponent has less ciphertext to work with for any given session key.
On theother hand, the distribution of session keys delays the start of any
exchange andplaces a burden on network capacity. A security manager must try
to balance thesecompeting considerations in determining the lifetime of a
particular session key.
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
keydistribution is fully decentralized. Although full decentralization is not
practical forlarger networks using symmetric encryption only, it may be useful
within a localcontext.
1. Public announcement
2. Publicly available directory
3. Public-key authority
4. Public-key certificates.
AUTHENTICATION REQUIREMENTS
• Hash function: A function that maps a message of any length into a fixed-
length hash value, which serves as the authenticator.
• Message encryption: The ciphertext of the entire message serves as its
authenticator.
• Message authentication code (MAC): A function of the message and a
secret key that produces a fixed-length value that serves as the
authenticator
MessageEncryption
Messageencryptionbyitselfcanprovideameasureofauthentication.Theanaly
sis differsforsymmetricandpublic-keyencryptionschemes.
to destination B is
encryptedusingasecretkeyKsharedbyAandB.Ifnootherpartyknowsthe key,
of the message.
as confidentiality.
accept any input X and produce output Y = D(K, X). If X is the ciphertext
profoundfromthepointofviewofauthentication.SupposethemessageMcanb
eany
arbitrarybitpattern.Inthatcase,thereisnowaytodetermineautomatically,a
tthe
destination,whetheranincomingmessageistheciphertextofalegitimatemess
regardless of the value of X, the value Y = D(K, X) is some bit pattern and
Thus, in general, we require that only a small subset of all possible bit
suppose that only one bit pattern in 106 is legitimate plaintext. Then the
desiredconditions
prevailasamatterofcourse.Forexample,supposethatwearetransmittingEngl
ish- language messages using a Caesar cipher with a shift of one (K = 1). A
Nbsftfbupbutboeepftfbupbutboemjuumfmbnctfbujwz
mareseatoatsanddoeseatoatsandlittlelambseativy
Asimplefrequencyanalysisconfirmsthatthismessagehastheprofileofordin
zuvrsoevgqxlzwigamdvnmhpmccxiuureosfbcebtqxsxq
this decrypts to
ytuqrndufpwkyvhfzlcumlgolbbwhttqdnreabdaspwrwp
English.Itmaybedifficulttodetermineautomaticallyifincomingciphertextd
ecrypts
tointelligibleplaintext.Iftheplaintextis,say,abinaryobjectfileordigitizedX
g messageswithrandomcontentpurportingtocomefromalegitimateuser.
IfthecalculatedFCSisequaltotheincomingFCS,thenthemessageisconsidere
redrelationship.
NotethattheorderinwhichtheFCSandencryptionfunctionsareperformed is
an
opponentwouldhavedifficultygeneratingciphertextthat,whendecrypted,w
ould have valid error control bits. If instead the FCS is the outer code, an
knowwhatthedecryptedplaintextwillbe,heorshecanstillhopetocreateconfu
structuring
addedtothetransmittedmessageservestostrengthentheauthenticationcap
ability.
Suchstructureisprovidedbytheuseofacommunicationsarchitectureconsisti
encryption
providesconfidentialitybutnotauthentication.Thesource(A)uses
thepublickeyPUbofthedestination(B)toencryptM.BecauseonlyBhasthecorr
esponding private key PRb, only B can decrypt the message. This scheme
providesnoauthentication,becauseanyopponentcouldalsouseB’spublickeyto
encryptamessageandclaimtobeA.
Toprovideauthentication,Ausesitsprivatekeytoencryptthemessage,andB
usesA’spublickeytodecrypt. Thisprovidesauthenticationusingthe
sametypeofreasoningasinthesymmetricencryptioncase:Themessagemusth
comefromAbecauseAistheonlypartythatpossessesPRaandthereforetheonl
be decrypted
withPUa.Again,thesamereasoningasbeforeapplies:Theremustbesomeinter
nal structure to the plaintext so that the receiver can distinguish between
Assumingthereissuchstructure,thentheschemeofFigure12.1cdoesprovide
recipient,couldhaveconstructedtheciphertext.Therefore,ifBisinpossessio
nof
theciphertext,Bhasthemeanstoprovethatthemessagemusthavecomefrom
A.
Ineffect,Ahas“signed”themessagebyusingitsprivatekeytoencrypt.Noteth
at
thisschemedoesnotprovideconfidentiality.AnyoneinpossessionofA’spublick
usingitsprivatekey,whichprovidesthedigitalsignature,andthenusingB’spubli
approachisthatthepublic-
keyalgorithm,whichiscomplex,mustbeexercisedfour
timesratherthantwoineachcommunication.
usingtheTCP/IPprotocolarchitecture.The above
suppose that each pair of hosts shared a unique secret key, so that all
regardlessofapplication.Thenwecouldsimplyencryptallofthedatagramexce
pattern for the encrypted TCP segment, the resulting plaintext would not
include a meaningful header. In this case, the header includes not only a
checksum (which covers the header) but also other useful information,
successiveTCPsegmentsonagivenconnectionarenumberedsequentially,encr
yptionassuresthatanopponentdoesnotdelay,misorder,ordeleteanysegment
s.
• The sender uses some publicly known MAC algorithm, inputs the message
and the secret key K and produces a MAC value.
• Similar to hash, MAC function also compresses an arbitrary long input into
a fixed length output. The major difference between hash and MAC is that
MAC uses secret key during the compression.
• The sender forwards the message along with the MAC. Here, we assume
that the message is sent in the clear, as we are concerned of providing
message origin authentication, not confidentiality. If confidentiality is
required then the message needs encryption.
• On receipt of the message and the MAC, the receiver feeds the received
message and the shared secret key K into the MAC algorithm and re-
computes the MAC value.
• The receiver now checks equality of freshly computed MAC with the MAC
received from the sender. If they match, then the receiver accepts the
message and assures himself that the message has been sent by the
intended sender.
• If the computed MAC does not match the MAC sent by the sender, the
receiver cannot determine whether it is the message that has been altered
or it is the origin that has been falsified. As a bottom-line, a receiver safely
assumes that the message is not the genuine.
Limitations of MAC
There are two major limitations of MAC, both due to its symmetric nature of
operation −
Both these limitations can be overcome by using the public key based digital
signatures discussed in following section.
HASH FUNCTIONS
Values returned by a hash function are called message digest or simply hash
values. The following picture illustrated hash function −
• Pre-Image Resistance
o This property means that it should be computationally hard to reverse a
hash function.
o In other words, if a hash function h produced a hash value z, then it should
be a difficult process to find any input value x that hashes to z.
o This property protects against an attacker who only has a hash value and
is trying to find the input.
• Second Pre-Image Resistance
o This property means given an input and its hash, it should be hard to find
a different input with the same hash.
o In other words, if a hash function h for an input x produces hash value
h(x), then it should be difficult to find any other input value y such that
h(y) = h(x).
o This property of hash function protects against an attacker who has an
input value and its hash, and wants to substitute different value as
legitimate value in place of original input value.
• Collision Resistance
o This property means it should be hard to find two different inputs of any
length that result in the same hash. This property is also referred to as
collision free hash function.
The size of each data block varies depending on the algorithm. Typically the block
sizes are from 128 bits to 512 bits. The following illustration demonstrates hash
function −
Hashing algorithm involves rounds of above hash function like a block cipher. Each
round takes an input of a fixed size, typically a combination of the most recent
message block and the output of the last round.
This process is repeated for as many rounds as are required to hash the entire
message. Schematic of hashing algorithm is depicted in the following illustration
−
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.
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.
Additionally, SHA uses MD5, SHA 1, or SHA 256 for symmetric cryptography.
They generate hash values to encrypt and decrypt data securely.
SHA-0: A retronym applied to the original version of the 160-bit hash function
published in 1993 under the name "SHA". It was withdrawn shortly after
publication due to an undisclosed "significant flaw" and replaced by the slightly
revised version SHA-1.
SHA-1: A 160-bit hash function which resembles the earlier MD5 algorithm. This
was designed by the National Security Agency (NSA) to be part of the Digital
Signature Algorithm. Cryptographic weaknesses were discovered in SHA-1, and
the standard was no longer approved for most cryptographic uses after 2010.
SHA-2: A family of two similar hash functions, with different block sizes, known
as SHA-256 and SHA-512. They differ in the word size; SHA-256 uses 32-bit
words where SHA-512 uses 64-bit words. There are also truncated versions of
each standard, known as SHA-224, SHA-384, SHA-512/224 and SHA-512/256.
These were also designed by the NSA.
SHA-3: A hash function formerly called Keccak, chosen in 2012 after a public
competition among non-NSA designers. It supports the same hash lengths as
SHA-2, and its internal structure differs significantly from the rest of the SHA
family.
SHA 2 is SHA 1’s upgraded algorithm. SHA 3 is SHA 2’s upgraded algorithm.
The general iterated hash structure proposed by Merkle is used in virtually all
secure hash functions. Preneelperformedia systematic analysis of block-cipher-
based hash functions. In this model, the hash code length equals the cipher block
length. Additional security problems are introduced and the analysis is more
difficult if the hash code length exceeds the cipher block length. Preneel devised
64 possible permutations of the basic model, based on which input served as the
encryption key and which served as plaintext and on what input, if any, was
combined with the ciphertext to produce the intermediate hash code. Based on
his analysis, he concluded that only schemes in which the plaintext was fed
forward and combined with the ciphertext were secure.
The encryption key input for each iteration is the intermediate hash value from
the previous iteration; the plaintext is the current message block; and the feed
forward value is the bitwise XOR of the current message block and the
intermediate hash value from the previous iteration.
The algorithm takes as input a message with a maximum length of less than 2 256
bits and produces as output a 512-bit message digest. The input is processed in
512-bit blocks.. The processing consists of the following steps:
HMAC
A hash function such as SHA was not designed for use as a MAC and cannot be
used directly for that purpose because it does not rely on a secret key. There
have been a number of proposals for the incorporation of a secret key into an
existing hash algorithm. The approach that has received the most support is
HMAC. HMAC has been issued as RFC 2104, has been chosen as the mandatory-
to-implement MAC for IP security, and is used in other Internet protocols, such
as SSL.
The first two objectives are important to the acceptability of HMAC. HMAC
treats the hash function as a "black box." This has two benefits. First, an existing
implementation of a hash function can be used as a module in implementing HMAC.
In this way, the bulk of the HMAC code is prepackaged and ready to use without
modification. Second, if it is ever desired to replace a given hash function in an
HMAC implementation, all that is required is to remove the existing hash function
module and drop in the new module. This could be done if a faster hash function
were desired.
The last design objective in the preceding list is, in fact, the main advantage of
HMAC over other proposed hash-based schemes. HMAC can be proven secure
provided that the embedded hash function has some reasonable cryptographic
strength.
HMAC Algorithm
In words,
The XOR with ipad results in flipping one-half of the bits of K. Similarly, the XOR
with opad results in flipping one-half of the bits of K, but a different set of bits.
In effect, by passing Si and So through the compression function of the hash
algorithm, we have pseudorandomly generated two keys from K.
CMAC
The Data Authentication Algorithm defined in FIPS PUB 113, also known as the
CBC-MAC (cipher block chaining message authentication code). This cipher-based
MAC has been widely adopted in government and industry.MAC is secure under a
reasonable set of security criteria, with the following restriction.
If the message is not an integer multiple of the cipher block length, then the final
block is padded to the right (least significant bits) with a 1 and as many 0s as
necessary so that the final block is also of length b. The CMAC operation then
precedes as before, except that a different n-bit key K2 is used instead of
K1.The two n-bit keys are derived from the k-bit encryption key as follows:
L = E (K, 0n)
K1 = L · x
K2 = L · x2 = (L · x) · x
where multiplication (·) is done in the finite field (2n) and x and x2 are first and
second order polynomials that are elements of GF(2n) Thus the binary
representation of x consists of n - 2 zeros followed by 10; the binary
representation of x2 consists of n - 3 zeros followed by 100. The finite field is
defined with respect to an irreducible polynomial that is lexicographically first
among all such polynomials with the minimum possible number of nonzero terms.
For the two approved block sizes, the polynomials are and x64 x4 x3 x 1 and x128
x7 x2 x 1. To generate K 1 and K2 the block cipher is applied to the block that
consists entirely of 0 bits.
DIGITAL SIGNATURE
Properties
Message authentication protects two parties who exchange messages from any
thirdparty. However, it does not protect the two parties against each other.
Several formsof dispute between the two are possible.
• It must verify the author and the date and time of the signature.
• It must authenticate the contents at the time of the signature.
• It must be verifiable by third parties, to resolve disputes.
HereA denotes the user whose signature method is being attacked, and C denotes
theattacker.
• Directed chosen message attack: Similar to the generic attack, except that
thelist of messages to be signed is chosen after C knows A’s public key but
beforeany signatures are seen.
non-negligible probability:
• The signature must be a bit pattern that depends on the message being
signed.
• The signature must use some information unique to the sender to prevent
both forgery and denial.
• It must be relatively easy to produce the digital signature.
• It must be relatively easy to recognize and verify the digital signature.
• It must be computationally infeasible to forge a digital signature, either
by constructing a new message for an existing digital signature or by
constructing a fraudulent digital signature for a given message.
• It must be practical to retain a copy of the digital signature in storage
The term direct digital signature refers to a digital signature scheme that
involvesonly the communicating parties (source, destination). It is assumed that
the destination knows the public key of the source.
The validity of the scheme just described depends on the security of the sender’s
private key. If a sender later wishes to deny sending a particular message, the
sender can claim that the private key was lost or stolen and that someone else
forged his or her signature.
KNAPSACK ALGORITHM
For the easy knapsack, we will choose a Super Increasing knapsack problem. Super
increasing knapsack is a sequence in which every next term is greater than the
sum of all preceding terms.
Example –
• Step-1:
Choose a super increasing knapsack {1, 2, 4, 10, 20, 40} as the private key.
• Step-2:
Choose two numbers n and m. Multiply all the values of private key by the
number n and then find modulo m. The value of m must be greater than the
sum of all values in private key, for example 110. And the number n should
have no common factor with m, for example 31.
1x31 mod(110) = 31
2x31 mod(110) = 62
4x31 mod(110) = 14
10x31 mod(110) = 90
20x31 mod(110) = 70
40x31 mod(110) = 30
• Thus, our public key is {31, 62, 14, 90, 70, 30}
And Private key is {1, 2, 4, 10, 20, 40}.
Example –
Lets our plain text is 100100111100101110.
1. Encryption :
As our knapsacks contain six values, so we will split our plain text in a groups
of six:
Multiply each values of public key with the corresponding values of each group
and take their sum.
2. Decryption :
The receiver receive the cipher text which has to be decrypt. The receiver
also know as the values of m and n.
So, first we need to find the n-1 , which is multiplicative inverse of n mod m i.e.,
Gcd of 110 & 31 is By Euclidean algorithm
110=3(31)+17 1 = 3- 1(2)
31 =1(17) + 14 1 = 5(3) -1(14)
Cryptography and Network Security, Dept. of CSE, AITS 107
17 = 1(14) + 3 1 = 11(14) – 9(17)
14 = 4(3) + 2 1 = 11(17) – 6(31)
n x n-1mod(m) = 1
31 xn-1mod(110) = 1
n-1 = 71
Now, we have to multiply 71 with each block of cipher text take modulo m.
121 x 71 mod(110) = 11
Then, we will have to make the sum of 11 from the values of private key {1, 2, 4,
10, 20, 40} i.e.,
1+10=11 so make that corresponding bits 1 and others 0 which is 100100.
Similarly,
197 x 71 mod(110) = 17
1+2+4+10=17 = 111100
IP SECURITY OVERVIEW
IP security (IPsec) is a capability that can be added to either current
version of the Internet Protocol (IPv4 or IPv6) by means of additional headers.
IPsec encompasses three functional areas: authentication, confidentiality, and
key management.
In 1994, the Internet Architecture Board (IAB) issued a report titled “Security
inthe Internet Architecture”
To provide security, the IAB included authentication and encryption as necessary
security features in the next-generation IP, which has been issued as
The principal feature of IPsec that enables it to support these varied applications
is that it can encrypt and/or authenticate all traffic at the IP level. Thus, all
distributed applications (including remote logon, client/server, e-mail, file
transfer, Web access, and so on) can be secured.
Benefits of IPsec
Some of the benefits of IPsec:
❖ When IPsec is implemented in a firewall or router, it provides strong
security that can be applied to all traffic crossing the perimeter. Traffic
within a company or workgroup does not incur the overhead of security-
related processing.
❖ IPsec in a firewall is resistant to bypass if all traffic from the outside
must useIP and the firewall is the only means of entrance from the
Internet into theorganization.
❖ IPsec is below the transport layer (TCP, UDP) and so is transparent
toapplications.
❖ IPsec can be transparent to end users.
❖ IPsec can provide security for individual users if needed.
Routing Applications
❖ Router advertisement (a new router advertises its presence) comes from
anauthorized router.
❖ A neighbor advertisement (a router seeks to establish or maintain a
neighbour relationship with a router in another routing domain) comes from
an authorized router.
❖ A redirect message comes from the router to which the initial IP packet
was sent.
❖ A routing update is not forged.
IPsec Services
IPsec provides security services at the IP layer by enabling a system to select
required security protocols, determine the algorithm(s) to use for the service(s),
and put in place any cryptographic keys required to provide the requested
services.
❖ Access control
❖ Connectionless integrity
❖ Data origin authentication
❖ Rejection of replayed packets (a form of partial sequence integrity)
❖ Confidentiality (encryption)
❖ Limited traffic flow confidentiality
IP SECURITY ARCHITECTURE
• Confidentiality
• Authentication
• Integrity
Packet Format:
7. Key Management: Key Management contains the document that describes how
the keys are exchanged between sender and receiver.
AUTHENTICATION HEADER
• Transport mode
• Tunnel mode
To protect these fields, tunnelling must be used. The payload of the IP packet is
considered immutable and is always protected by AH.
AH format
The AH format is described in RFC 2402. The below shows the position of the
Authentication Header fields in the IP packet.
Next header
It is an 8-bit field which identifies the type of what follows. The value of this
field is chosen from the set of IP header protocol fields, which is set to 51, and
the value that would have gone in the protocol field goes in the AH next header
field.
Payload length
It is an 8 bits long field and contains the length of the AH header expressed in
32-bit words, minus 2. It does not relate to the actual payload length of the IP
packet. Suppose if default options are used, the value is 4 (three 32-bit fixed
words plus three 32-bit words of authentication data minus two).
It is reserved for future use. Its length is 16 bits and it is set to zero.
It is 32 bits in length.
Sequence number
This 32-bit field is a monotonically increasing counter, which is used for replay
protection. It is an optional field. The sender always includes this field, and it is
at the discretion of the receiver to process it or not. Starting the sequence
number is initialized to zero. The first packet transmitted using the SA has a
sequence number of 1. Sequence numbers are not allowed to repeat.
Authentication data
This is a variable-length field containing the Integrity Check Value (ICV), and is
padded to 32 bits for IPv4 or 64 bits for IPv6.
ESP Format
Figure 19.5a shows the top-level format of an ESP packet. It contains the
followingfields.
When any combined mode algorithm is employed, the algorithm itself isexpected
to return both decrypted plaintext and a pass/fail indication for the integrity
check.
Padding
Figure 19.7 shows two ways in which the IPsec ESP service can be used. In the
upperpart of the figure, encryption (and optionally authentication) is provided
directly between two hosts. Figure 19.7b shows how tunnel mode operation can be
used to set up a virtual private network.
An individual SA can implement either the AH or ESP protocol but not both.
Sometimes a particular traffic flow will call for the services provided by both AH
and ESP.
Case 1. All security is provided between end systems that implement IPsec. For
any two end systems to communicate via an SA, they must share the appropriate
secret keys.
Case 2. Security is provided only between gateways (routers, firewalls, etc.) and
no hosts implement IPsec. This case illustrates simple virtual private network
support.
Case 4. This provides support for a remote host that uses the Internet to reach
anorganization’s firewall and then to gain access to some server or workstation
behindthe firewall.
KEY MANAGEMENT
• Manual: A system administrator manually configures each system with its own
keys and with the keys of other communicating systems. This is practical for
small, relatively static environments.
ISAKMP provides a framework for Internet key management and provides the
specific protocol support, including formats, for negotiation of security
attributes.
Exchange Type (8 bits): Indicates the type of exchange; these are discussed
later in this section.
• Flags (8 bits): Indicates specific options set for this IKE exchange. Three bits
are defined so far. The initiator bit indicates whether this packet is sent by the
SA initiator. The version bit indicates whether the transmitter is capable of using
a higher major version number than the one currently indicated. The response bit
indicates whether this is a response to a message containing the same message
ID.
• Length (32 bits): Length of total message (header plus all payloads) in octets
Another way to classify Web security threats is in terms of the location of the
threat: Web server, Web browser, and network traffic between browser and
server.
One way to provide Web security is to use IP security (IPsec) (Figure 16.1a). The
advantage of using IPsec is that it is transparent to end users and applications
and provides a general-purpose solution.
SSL Architecture
The SSL Record Protocol provides basic security services to various higher-layer
protocols. In particular, the Hypertext Transfer Protocol (HTTP), which provides
the transfer service for Web client/server interaction, can operate on top of
SSL. Three higher-layer protocols are defined as part of SSL: the Handshake
Protocol, The Change Cipher Spec Protocol, and the Alert Protocol. These SSL-
specific protocols are used in the management of SSL exchanges and are
examined later in this section
The SSL Record Protocol provides two services for SSL connections:
Confidentiality: The Handshake Protocol defines a shared secret key that is used
for conventional encryption of SSL payloads.
Message Integrity: The Handshake Protocol also defines a shared secret key
that is used to form a message authentication code (MAC).
Version Number
The TLS Record Format is the same as that of the SSL Record Format For the
current version of TLS, the major version is 3 and the minor version is 3.
There are two differences between the SSLv3 and TLS MAC schemes: the
actualalgorithm and the scope of the MAC calculation. TLS makes use of the
Pseudorandom Function
Alert Codes
TLS supports all of the alert codes defined in SSLv3 with the exception of
no_certificate. A number of additional codes are defined in TLS; of these, the
following are always fatal.
Secure Electronic Transaction or SET is a system that ensures the security and
integrity of electronic transactions done using credit cards in a scenario. SET is
not some system that enables payment but it is a security protocol applied to
those payments. It uses different encryption and hashing techniques to secure
payments over the internet done through credit cards. The SET protocol was
supported in development by major organizations like Visa, Mastercard,
Microsoft which provided its Secure Transaction Technology (STT), and
Netscape which provided the technology of Secure Socket Layer (SSL).
SET protocol restricts the revealing of credit card details to merchants thus
keeping hackers and thieves at bay. The SET protocol includes Certification
Authorities for making use of standard Digital Certificates like X.509
Certificate.
INTRUDER
The most common threat to security is the attack by the intruder. Intruders are
often referred to as hackers and are the most harmful factors contributing to
the vulnerability of security. They have immense knowledge and an in-depth
understanding of technology and security. Intruders breach the privacy of users
and aim at stealing the confidential information of the users. The stolen
information is then sold to third-party, which aim at misusing the information for
their own personal or professional gains.
INTRUSION DETECTION
Intrusions might occur from the outside or from within your network structure
(an employee, customer, or business partner). Some intrusions are just aimed to
alert you that an intruder has entered your site and is defacing it with various
messages or obscene graphics. Others are more malevolent, attempting to
harvest sensitive data on a one-time basis or as part of a long-term parasitic
connection that will continue to siphon data until it is identified.
Some intruders will try to implant code that has been carefully developed. Others
will infiltrate the network, stealthily siphoning out data on a regular basis or
altering public-facing Web sites with varied messages.
An attacker can acquire physical access to your system (by physically accessing a
restricted computer and its hard drive and/or BIOS), externally (by assaulting
your Web servers or breaching your firewall), or internally (by physically
accessing a restricted machine and its hard disc and/or BIOS) (your own users,
customers, or partners).
The IDS can readily identify malformed information packets, DNS poisonings,
Xmas scans, and other polluted materials, which can have a severe impact on your
overall network performance.
PASSWORD MANAGEMENT
There are many challenges in securing passwords in this digital era. When the
number of web services used by individuals are increasing year-over-year on one
end, the number of cyber crimes is also skyrocketing on the other end. Here are
a few common threats to protecting our passwords:
• Login spoofing - Passwords are illegally collected through a fake login page
by cybercriminals.
• Sniffing attack - Passwords are stolen using illegal network access and
with tools like key loggers.
• Shoulder surfing attack - Stealing passwords when someone types them,
at times using a micro-camera and gaining access to user data.
• Brute force attack - Stealing passwords with the help of automated tools
and gaining access to user data.
All of these threats create an opportunity for attackers to steal user passwords
and enjoy unlimited access benefits. Let's take a look at how individuals and
businesses typically manage their passwords.
While hackers are equipped with advanced tools and attacks, individuals and
businesses still rely on traditional methods of password management. This clearly
raises the need for the best password management practices to curb security
threats.
• Use strong and unique passwords for all websites and applications
• Reset passwords at regular intervals
• Configure two-factor authentication for all accounts
• Securely share passwords with friends, family, and colleagues
• Store all enterprise passwords in one place and enforce secure password
policies within the business environment
• Periodically review the violations and take necessary actions.
Malicious Programs
Malicious software can be divided into two categories: those that need a host
program, and those that are independent.
A virus is a piece of software that can "infect" other programs by modifying them;
the modification includes a copy of the virus program, which can then go on to
infect other programs.
A virus can do anything that other programs do. The only difference is that it
attaches itself to another program and executes secretly when the host program
is run. Once a virus is executing, it can perform any function, such as erasing files
and programs.
During its lifetime, a typical virus goes through the following four phases:
Dormant phase: The virus is idle. The virus will eventually be activated by some
event, such as a date, the presence of another program or file, or the capacity of
the disk exceeding some limit. Not all viruses have this stage.
Propagation phase: The virus places an identical copy of itself into other
programs or into certain system areas on the disk. Each infected program will now
contain a clone of the virus, which will itself enter a propagation phase.
Triggering phase: The virus is activated to perform the function for which it was
intended. As with the dormant phase, the triggering phase can be caused by a
variety of system events, including a count of the number of times that this copy
of the virus has made copies of itself.
Execution phase: The function is performed. The function may be harmless, such
as a message on the screen, or damaging, such as the destruction of programs and
data files.
Virus Structure
An infected program begins with the virus code and works as follows.
The first line of code is a jump to the main virus program. The second line is a
special marker that is used by the virus to determine whether or not a potential
victim program has already been infected with this virus.
This action could be performed every time the program is invoked, or it could be
a logic bomb that triggers only under certain conditions.
Finally, the virus transfers control to the original program. If the infection phase
of the program is reasonably rapid, a user is unlikely to notice any difference
between the execution of an infected and uninfected program.
A virus such as the one just described is easily detected because an infected
version of a program is longer than the corresponding uninfected one. A way to
thwart such a simple means of detecting a virus is to compress the executable
file so that both the infected and uninfected versions are of identical length..
The key lines in this virus are numbered. We assume that program P1 is infected
with the virus CV. When this program is invoked, control passes to its virus, which
performs the following steps:
1. 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.
Characteristics of Firewall
1. Physical Barrier: A firewall does not allow any external traffic to enter a
system or a network without its allowance. A firewall creates a choke point
for all the external data trying to enter into the system or network and
hence can easily block the access if needed.
2. Multi-Purpose: A firewall has many functions other than security purposes.
It configures domain names and Internet Protocol (IP) addresses. It also
acts as a network address translator. It can act as a meter for internet
usage.
3. Flexible Security Policies: Different local systems or networks need
different security policies. A firewall can be modified according to the
requirement of the user by changing its security policies.
4. Security Platform: It provides a platform from which any alert to the
issue related to security or fixing issues can be accessed. All the queries
related to security can be kept under check from one place in a system or
network.
5. Access Handler: Determines which traffic needs to flow first according
to priority or can change for a particular network or system. specific action
requests may be initiated and allowed to flow through the firewall.
Every network security device has its purpose and its way of implementation. if
we use the wrong device for the wrong problem, the network becomes vulnerable.
if the outdated device is used for a designing firewall, it exposes the network to
risk and is almost useless. Firstly the designing part must be done then the
product requirements must be found out, if the product is already available then
it is tried to fit in a design that makes security weak.
4. Layered Defense
A network defense must be multiple layered in the modern world because if the
security is broken, the network will be exposed to external attacks. Multilayer
security design can be set to deal with different levels of threat. It gives an edge
to the security design and finally neutralizes the attack over the system.
TYPES OF FIREWALL
Types of Firewall:
Packet Filters
It is also a type of packet filtering which is used to control how data packets
move through a firewall. It is also called dynamic packet filtering. These firewalls
can inspect that if the packet belongs to a particular session or not. It only
permits communication if and only if, the session is perfectly established between
two endpoints else it will block the communication.
These firewalls can examine application layer (of OSI model) information like an
HTTP request. If finds some suspicious application that can be responsible for
harming our network or that is not safe for our network then it gets blocked right
away.
Next-generation Firewalls
These firewalls are called intelligent firewalls. These firewalls can perform all
the tasks that are performed by the other types of firewalls that we learned
previously but on top of that, it includes additional features like application
Cryptography and Network Security, Dept. of CSE, AITS 148
awareness and control, integrated intrusion prevention, and cloud-delivered
threat intelligence.
Circuit-level gateways
Software Firewall
The software firewall is a type of computer software that runs on our computers.
It protects our system from any external attacks such as unauthorized access,
malicious attacks, etc. by notifying us about the danger that can occur if we open
a particular mail or if we try to open a website that is not secure.
Hardware Firewall
Cloud Firewall
• Halt Hacking
• Stops viruses
• Cost
Depending on the type of firewall, it can be costly, usually, the hardware
firewalls are more costly than the software ones.
Restricts User
Restricting users can be a disadvantage for large organizations, because of its
tough security mechanism. A firewall can restrict the employees to do a
certain operation even though it’s a necessary operation.
• Issues with the speed of thenetwork
Since the firewalls have to monitor every packet passing through the network,
this can slow down operations needed to be performed, or it can simply lead
to slowing down the network.
• Maintenance
Firewalls require continuous updates and maintenance with every change in the
networking technology. As the development of new viruses is increasing
continuously that can damage your system.
Currently, EPS has minimal data security. As the system operates in a closed
network, the currentsecurity infrastructure may suffice the need. The data
moving across the network is in encryptedformat.
Current EPS Architecture EPS is used to transmit payment details from the payer
branch to thepayee branch via the central server in Mumbai. Fig. 10.5 depicts the
flow, which is also described step-by-step
1. A data-entry person in the Payer Branch enters transaction details through the
EPS interface.
2. A Bank Officer checks the validity of the transaction through the EPS
interface.
3. After validating the transaction, the Bank Officer authorizes the transaction.
Authorizedtransaction is stored in a local Payment Master (PM) database.
On the Payee Leg, the EPS central office will create a Credit Request as before,
sign and encrypt itwith the bank officer’s digital certificate. This signed-and-
encrypted request will be forwarded to thePayee Branch.
VIRTUAL ELECTIONS
Computerized voting wouldbecome quite common in the next few decades. As
such, it is important that the protocol for virtualelections should protect
individual privacy and should also disallow cheating. Consider the followingprotocol
in order that voters can send their votes electronically to the Election Authority
(EA).
1. The EA does not know whether the authorized voters have voted or it has
received fake (bogus)votes.
2. Secondly, there is no mechanism to prevent duplicate voting.
What is the advantage of this protocol? Clearly, no one would be able to change
another voter’s vote,because it is first encrypted with the EA’s public key and is
then sent to the EA. However, if we observethis scheme carefully, an attacker
need not change someone’s vote at all. The attacker can simply send duplicate
votes!
How can we improve upon this protocol to make it more robust? Let us rewrite it,
as follows:
1. Each voter casts the vote and signs it with her private key
2. Each voter then encrypts the signed vote with the public key of the EA.