Fixed crypted connection

A packet header could eventually be decrypted twice which could result
in invalid packet header.