Network Security
Network Security
Introduction
The word cryptography has come from a Greek word, which means secret writing. In
the present day context it refers to the tools and techniques used to make messages secure
for communication between the participants and make messages immune to attacks by
hackers. For private communication through public network, cryptography plays a very
crucial role. The role of cryptography can be illustrated with the help a simple model of
cryptography as shown in Fig. 8.1.1. The message to be sent through an unreliable
medium is known as plaintext, which is encrypted before sending over the medium. The
encrypted message is known as ciphertext, which is received at the other end of the
medium and decrypted to get back the original plaintext message. In this lesson we shall
discuss various cryptography algorithms, which can be divided into two broad categorize
- Symmetric key cryptography and Public key cryptography. Cryptography
algorithms based on symmetric key cryptography are presented in Sec. 8.1.2. Public key
cryptography has been addressed in Sec. 8.1.3.
Requirement of large number of unique keys. For example for n users the
algorithms suffer from the following limitations:
x Key feature of this approach is that it is more complex and the code is harder to attack
successfully.
Transpositional cipher is also not a very secure approach. The attacker can find
the plaintext by trial and error utilizing the idea of the frequency of occurrence of
characters.
Figure 8.1.5. Operation of a transpositional cipher
Substitution: As shown in Fig. 8.1.8, the substitution is implemented with the help of
three building blocks – a decoder, one p-box and an encoder. For an n-bit input, the
decoder produces an 2n bit output having only one 1, which is applied to the P-box. The
P-box permutes the output of the decoder and it is applied to the encoder. The encoder, in
turn, produces an n-bit output. For example, if the input to the decoder is 011, the output
of the decoder is 00001000. Let the permuted output is 01000000, the output of the
encoder is 011.
Figure 8.1.8. Substitution operation used in Block Ciphers
All the above three steps are repeated for an optimal number of rounds.
x The decryption can be done with the same password; the stages must then be
only 56 bits in length.
x DES has 16 rounds, meaning the main algorithm is repeated 16 times to produce
carried out in reverse order.
x Once the key scheduling and plaintext preparation have been completed, the
exponentially.
actual encryption or decryption is performed with the help of the main DES
algorithm as shown in Fig. 8.1.10.
This is part of the regular DES algorithm. Data is divided into 64-bit blocks and each
block is encrypted one at a time separately as shown in Fig. 8.1.11. Separate encryptions
with different blocks are totally independent of each other.
Disadvantages of ECB
x
these blocks are identical. This may give some information to the eavesdropper
x
Someone can modify or rearrange blocks to his own advantage
Because of these flaws, ECB is rarely used
In this mode of operation, encrypted ciphertext of each block of ECB is XORed with the
next plaintext block to be encrypted, thus making all the blocks dependent on all the
previous blocks. The initialization vector is sent along with data as shown in Fig. 8.1.12.
Figure 8.1.12 Cipher Block Chaining (CBC) encryption technique
x In this mode, blocks of plaintext that is less than 64 bits long can be encrypted as
x
shown in Fig. 8.1.13.
x
This is commonly used with interactive terminals
It can receive and send k bits (say k=8) at a time in a streamed manner
The encryption technique of Output Feedback Mode (OFB) is shown in Fig. 8.1.14. Key
x CBC is used to turn the block encryption scheme into a stream encryption scheme
encryption by K1 in a sequence as shown in Fig. 8.1.15
x Advantages:
o The pair of keys can be used with any other entity
x
o The number of keys required is small
Disadvantages:
o It is not efficient for long messages
o Association between an entity and its public key must be verified
8.1.3.1 RSA
The most popular public-key algorithm is the RSA (named after their inventors Rivest,
Shamir and Adleman) as shown in Fig. 8.1.17. Key features of the RSA algorithm are
x Public key algorithm that performs encryption as well as decryption based on number
given below:
x Variable key length; long for enhanced security and short for efficiency (typical 512
theory
x The private key is a pair of numbers (d, n) and the public key is also a pair of
Review Questions
1.What do you mean by encryption and decryption?
3. For n number of users, how many keys are needed if we use private and public
key cryptography schemes?
Ans: For n users n(n-1)/2 keys are required in private key cryptography and 2n keys are
required in public key cryptography.
1.Ans: It was realized that the DES key length was too short to provide high security.
Triple DES was used to make DES more secure by effectively increasing the key length.
Here two keys are used in three stages.
5. Explain how RSA works.