How to design a secure data container?
You should encrypt the data using a well-vetted standard, like TLS (for data in motion) or GPG (for data at rest).  Designing your own is more likely to lead to sadness.  The format of the data that you protect in this way is up to you and can be broken down into structs and chunks and headers etc. to your heart's delight.