In: Computer Science
Convert "hello world" into hex "hello world" in hex = 68656c6c6f20776f726c64
encrypt the above binary content with a 4 bit block cipher whose codebook consists of 6, 0, 13, 4, 3, 1, 14, 8, 7, 12, 9, 15, 5, 2, 11, 10 (The codebook is simply the output blocks in the order of the integers corresponding to the 16 possible input blocks).
What will the encrypted output be for this text?
public class DecyptHex {
public static void main(String args[]){
String string = "hello world";
System.out.println("The hello world converstion into hex is ");
for(int i=0;i<string.length();++i)
System.out.printf("%x",(int)(string.charAt(i)));
System.out.println();
int arr[] = new int[]{6, 0, 13, 4, 3, 1, 14, 8, 7, 12, 9, 15, 5, 2, 11, 10 };
System.out.println("the encrypted output be for this text is: ");
for(int i=0;i<arr.length;++i)
System.out.printf("%x",arr[i]);
}
}
==============================================================================
Let me know if things are fine, tell me if you need in
Different Language
....I have given the Encrypted text as well as the Output have a
look