Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Hill Cipher

# Hill Cipher

Ratings: (0)|Views: 4,264|Likes:
Hill Cipher implementaion using java.
Hill Cipher implementaion using java.

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

06/30/2013

pdf

text

original

Name: Dil Prasad Kuwor Date: 10/5/2010Roll no. : 02/064Subject: CryptographyAssignment no. : Lab No. 2
1
Q.5
Generate the Hill cipher from the given plain text using 3 × 3 matrix. No need todecrypt.
Testing DataPlain Text :- paymoremoney Cipher Text:- LNSHDLEWMTRW

Java Code:
import java.util.*;class HillCipher{public static void main (String[] args){String letter1[] = {"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" };Scanner in = new Scanner(System.in);System.out.println("***** Hill Cipher *****");String plainText,cipherText="";int p[][]=new int [3][3];int key[][]={{17,17,5},{21,18,21},{2,2,19}};int c[][]= new int [3][3];int x=0,index = 0;System.out.println("Enter the plaintext:");plainText=in.nextLine();for(int i=0;i<plainText.length();i+=3){for(int j=0;j<3;j++){String index1;if(i+j<plainText.length()){char a= plainText.charAt(i+j);String va = String.valueOf(a);index1=findIndex(va);int k=0;p[j][k]=Integer.parseInt(String.valueOf(index1));}}int sum=0;for(int l=0; l<3; l++){for(int j=0; j<1; j++){

## Activity (16)

You've already reviewed this. Edit your review.