You are on page 1of 1

Cryptography & System Security Lab Manual (CSL602) SEM VI (Computer Engineering)

Programming Assignments:

Exp-1

Aim: To implement a program in java for password cracking using Brute Force.

A brute-force attack is a cryptanalytic attack that can, in theory, be used to attempt to decrypt
any encrypted data (except for data encrypted in an information-theoretically
secure manner. Such an attack might be used when it is not possible to take advantage of
other weaknesses in an encryption system (if any exist) that would make the task easier.
We assume the input to be a password to be of length 4 and having only lowercase letters.
We try all possible combinations of lower-case letters to try and decode the password.

Input:

1. Enter password of length 4


2. Convert it into string
3. Find length of the string
4. Starting at each iteration: Guess the string
5. If it matches then print the string and no. of iterations

Output:

1. Print the password


2. Print the iteration number in which the password was cracked successfully

Exp-2

Aim: Implementation of Caesar cipher

Example:

It is a type of substitution cipher in which each letter in the plaintext is shifted by a certain
number of places. The key is the number of characters to shift the cipher alphabet.

First we translate all of our characters to numbers, 'a'=0, 'b'=1, 'c'=2, ... , 'z'=25.

We can now represent the caesar cipher encryption function, e(x), where x is the character we
are encrypting, as:

Where k is the key (the shift) applied to each letter.

You might also like