I tried to encrypt with the OTP (One Time Pad). I have coded a "test"-code to see if I make everything right, or not.
final String message = "Hello";
char character;
String binary;
for (int i = 0; i < message.length(); i++) {
character = message.charAt(i);
binary = Integer.toBinaryString(character);
System.out.println(character + ": " + binary);
}
So, there are the following:
H: 1001000
e: 1100101
l: 1101100
l: 1101100
o: 1101111
That is not really correct. I've searched in the inet, for example, the binary of H
01001000
There is one "0" missing. How can i fix this?