Wrapping encoding and decoding messages