How to provide partial confidentiality and full integrity for a protocol message?
Basically what you want is a authenticated encryption with associated data (AEAD) encryption scheme, of which there are several already available in various libraries.  So just see what is available on your system and use one of them.