I recently had an interesting experience with the varbinary column in SQL Server.
Here was my problem:
I was inserting 0x012 into a varbinary column with the expectation that is what would be stored. Perhaps taking into consideration byte alignment it would pad a 0 at the end, i.e 0x0120. Boy was I wrong. The value was stored as 0x0102. Since my input value was 1.5 bytes, SQL Server padded the value to make it a full 2 bytes by prepending a 0 to the last 4 bits to make a full byte. That is a completely different value than what I was intending during the insert. After some chatting with some people in the SQL organization I finally realized why SQL Server treats it as 0x0102 instead of 0x0120. As humans, we tend to think of things that end with 0 as a bigger number but in the binary world 0x01 is the same as 0x0100.
From now on I'll be sure to pad my varbinary values to ensure my intent is preserved. :)