Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Hill Cipher

Hill Cipher

Ratings: (0)|Views: 4,264|Likes:
Published by Dil Prasad Kunwar
Hill Cipher implementaion using java.
Hill Cipher implementaion using java.

More info:

Published by: Dil Prasad Kunwar on Apr 11, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Name: Dil Prasad Kuwor Date: 10/5/2010Roll no. : 02/064Subject: CryptographyAssignment no. : Lab No. 2
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.
1 hundred reads
1 thousand reads
andrei_dragos_4 liked this
danut89 liked this
Priya Sajith liked this
Nishant Gupta liked this
Kanwar Cheema liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->