cipherlen = cipher.getBlockSize();
}
// Compress the payload if necersary
if (compression != null) {
msgdata = compression.compress(msgdata, 0, msgdata.length);
}
//Determine the padding length
padding += ((cipherlen -
((msgdata.length + 5 + padding) % cipherlen)) % cipherlen);