I am in need of some explanations on the corresponding line, which I do not understand:
KeyGenerationParameters kgp = new KeyGenerationParameters(sr,(DESParameters.DES_KEY_LENGTH) * 8);
Would it stop working, if I had, for instance, the number 6 instead of 8?
It is multiplied by 8 because it is in bytes otherwise. The code wants bits.