Encrypted length prepending and MAC integrity check in handshake