Professional Documents
Culture Documents
import java.util.*;
//Decryption
System.out.println("Decryption: ");
IntermediateCipher = (ciphertext ^ key);
System.out.println("Intermediate Cipher = " + String.format("%4s",
Integer.toBinaryString(IntermediateCipher)).replaceAll(" ", "0"));
//Right shift of Intermediate cipher
IntermediateCipherDec =
Integer.parseInt(String.valueOf(Integer.toBinaryString(IntermediateCipher)),2);
lsmessage2 = IntermediateCipherDec >> 1;
System.out.println("Decrypted text = " + String.format("%4s",
Integer.toBinaryString(lsmessage2)).replaceAll(" ", "0"));
} }