I am using DES Encryption in Java using BigIntegers.
I transfer binary keys using Java BigIntegers by executing the BigInteger.leftShift (int n) method. The key N (Kn) depends on the result of the Kn-1 shift. The problem I get is that I print out the results after creating each key, and the offset is not expected. The key is divided into 2 Cn and Dn (left and right, respectively).
I specifically try to do this: "To make a left shift, move each bit one place to the left, except for the first bit, which will cyclically move to the end of the block."
It seems to be superimposed on O at the end depending on the shift. Not sure how to fix it.
Results:
c0: 11110101010100110011000011110
d0: 11110001111001100110101010100
c1: 11110101010101001100110000111100
d1: 111100011110011001101010101000
c2: 11110101010100110011000011110000
d2: 11110001111001100110101010100000
c3: 111101010101010011001100001111000000
d3: 1111000111100110011010101010000000
c4: 111101010101001100110000111100000000
d4: 111100011110011001101010101000000000
c5: 11110101010100110011000011110000000000
d5: 111100011110011001101010101000000000000000
c6: 1111010101010011001100001111000000000000
d6: 1111000111100110011010101010000000000000
c7: 11110101010101001100110000111100000000000000
d7: 1111000111100110011010101010000000000000000000
c8: 1111010101010011001100001111000000000000000
d8: 11110001111001100110101010100000000000000000000
c9: 11110101010101001100110000111100000000000000000
d9: 1111000111100110011010101010000000000000000000000
c10: 1111010101010100110011000011110000000000000000000
d10: 111100011110011001101010101000000000000000000000000
c11: 111101010101010011001100001111000000000000000000000
d11: 11110001111001100110101010100000000000000000000000000
c12: 11110101010101001100110000111100000000000000000000000000
d12: 1111000111100110011010101010000000000000000000000000000
c13: 1111010101010100110011000011110000000000000000000000000
d13: 111100011110011001101010101000000000000000000000000000000
c14: 111101010101010011001100001111000000000000000000000000000000
d14: 11110001111001100110101010100000000000000000000000000000000
c15: 11110101010101001100110000111100000000000000000000000000000000
d15: 111100011110011001101010101000000000000000000000000000000000