Implement message writer.

The protocol dictates every frame has a different, cryptographically strong mask via random generation.