Top Banner
G.L. Bajaj Institute of Technology and Management, Greater Noida Cryptography and Network Security PRACTICAL FILE TIT-751 SUBMITTED TO SUBMITTED BY 1
28

Cryptography Practical File

Oct 24, 2014

Download

Documents

Ankush
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

G.L. Bajaj Institute of Technology and Management, Greater Noida

Cryptography and Network SecurityPRACTICAL FILE

TIT-751

SUBMITTED TO Ms. Puja Bharti

SUBMITTED BYName: R.No.B.TECH (IT 4th YEAR)

1

INDEX Sl.No. Name of Practicals PageNo. 1. 2. Caesar Cipher implementation Eucledian Algorithm Euclidean Algorithm for 10 numbers stored in array Implementation of RSA algorithm Implementation of LCG algorithm Implementation of miller rabin algorithm 3-5 6-7 Date Remarks & Signature

3.

8-9

4. 5.

10-12 13-18

6.

19-22

7.

2

PROGRAM 1

Caesar Cipher Algorithm:Earliest known use of substitution cipher was by Julius Caesar. 1. assign a numerical equivalent to each letter a=0 b=1 c=2 . . . . . . y = 24 z = 25. 2. For each plain text letter p, substitute the cipher text letter C As C = E(3,p) = ( p+3) mod 26. 3. general Caesar algorithm is C = E(k,p) = (p+k) mod26 P = D(k,C) = (C- k)mod26

3

Implementation of Caesar cipher :/*caesar cipher */ #include #include void main() { int i, a, b; char array [5]; clrscr(); printf("Enter the characters to be encrypted \n"); for(i=0;i