for (int pos = 1; pos < paddingLength; pos++) {
if (plainBlock.byteAt(plainBlock.length() - 1 - pos) != paddingLength) {
throw new Exception("Incorrect padding");
}
}
plainBlock = plainBlock.range(0, plainBlock.length()
- paddingLength);
}
System.out.println("The decryption of block " + i + " is: "
+ plainBlock.toString());
plain = plain.append(plainBlock);