Perhaps you should have obscured the purpose of the thing you did not know how to do and asked about. You might have just titled you post
Combining uint32_t and byte array
and talked about something general. Which it is.
Leave encryption out of it. At the least, you'd be less annoyed by all the "off topic" observations.
a7