Format for Lab11

October 10, 2017 | Author: IshwarDattMishra | Category: Cipher, Key (Cryptography), Secrecy, Physics & Mathematics, Mathematics
Share Embed Donate


Short Description

CNS lab manual...

Description

Index S.no

Introduction

The format for cryptography lab is given below 1. 2. 3. 4. 5.

Front page (Name, roll no., department, semester, subject name and subject code). List of experiments prescribed by the university. Time table of instructional laboratory. Index Each experiment written in following manner (I) Experiment no. (II) Name of experiment (III) Objective of performing experiment (IV) Theory (in brief but be sufficient) (V) Program code (VI) Output of the program

List of experiments prescribed by the university (TIT-751) CRYPTOGRAPHY AND NETWORK SECURITY LAB

The following programs should be implemented preferably on ' UNIX' platform using 'C' language (for 15) and other standard utilities available with 'UNIX' systems (for 6-8) :-

1.

Implement the encryption and decryption of 8-bit data using 'Simplified DES Algorithm' (created by Prof. Edward Schaefer) in 'C'.

2.

Implement 'Linear Congruential Algorithm' to generate 5 pseudo-random numbers in 'C'.

3.

Implement Rabin-Miller Primality Testing Algorithm in 'C'.

4.

Implement the Euclid Algorithm to generate the GCD of an array of 10 integers in 'C'.

5.

Implement RSA algorithm for encryption and decryption in 'C'.

6.

Configure a mail agent to support Digital Certificates, send a mail and verify the correctness of this system using the configured parameters.

7.

Configure SSH (Secure Shell) and send/receive a file on this connection to verify the correctness of this system using the configured parameters.

8.

Configure a firewall to block the following for 5 minutes and verify the correctness of this system using the configured parameters:

(a)

Two neighborhood IP addresses on your LAN

(b)

All ICMP requests

(c)

All TCP SYN Packets

Experiment no. 1 Objective of performing experiment: Data encryption/decrytion using S-DES

CAESAR CIPHER: It was used by Julius Caesar. The Caesar cipher involves replacing each letter of the alphabet with the letter standing three places further down the alphabet

For example Plain: meet

me after

the

toga

party

Cipher: PHHW PH DIWHU WKH WRJD SDUWB Transformation is made using the following mapping: Plain:

a bc d efgh i j k l mno pq r s t u v wxy z

Cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C Let us assign a numerical equivalent to each letter from 0 to 25. Then the algorithm may be expressed as follows. For each plaintext letter p, substitute the ciphertext letter C:

C=E(p)=(p+3) mod 26 A shift may be of any amount, so that general Caesar algorithm is

C=E(p)=(p+k) mod 26, Where k takes on a value in the range 1 to 25. The decryption algorithm is simply

P=D(C)=(C-k) mod 26 If it is known that a given ciphertext is a Caesar cipher, then a brute-force cryptanalysis is easily performed: simply try all possible 25 keys. Three important characteristics of this problem enable us to use brute-force cryptanalysis: 1.

The encryption and decryption algorithms are known

2.

There are only 25 keys to try

3.

The language of the plaintext is known and easily recognizable

In most networking situations algorithms are assumed to be known. Brute-force analysis is impractical when algorithm employs large of keys. The 3rd characteristic is also significant. If the language of the plaintext is not known, then the plaintext output may not be recognizable.

Furthermore, if the input is compressed in some manner, again recognition is difficult. Below is example of compression by ZIP:

If this file is then encrypted with a simple substitution cipher (expanded to include more than just 26 characters), then the plaintext may not be recognized.

Program : Encryption/Decryption using Caesar Cipher */ #include #include #include int SQR(int x) { int yes=0, i=1; while(i
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF