title: Convert object to byte[]
body: <p>I am trying to convert a retrieved registry value from <code>object</code> to <code>byte[]</code>. It is stored as <code>REG_BINARY</code>. I tried using <code>BinaryFormatter</code> with <code>MemoryStream</code>. However, it adds overhead information that I do not want. I observed this when I then converted the byte array to a string by performing the function <code>Convert.ToBase64String(..)</code>. I am performing these functions because I am testing the storing and retrieval of an encrypted key in the registry.</p>