With apologies to the game show...

I was working on a cryptography project, and, without going into detail (it's SECRET, duh), I was having some issues. The other party sent me their test key in a text file, and it was Base64 encoded. Naturally, being the smart id10t that I am, I popped open my handy dandy, Base64 decoder site, decoded the string, and placed the string in the proper location for it to be used in the decoding process. Lo and behold the decryption process broke...because the key was too small!

In my investigation, it turns out that decoding it by any means other than Convert.FromBase64String() resulted in a byte array with only 31 bytes. Since a 256-bit key requires a 32-byte array, that posed an issue. Luckily, instead of reading the individual bytes from the key store (via a FileStream.Read() operation), I read it from the key store using a  StreamReader.ReadToEnd() operation, then transferred it to the byte[32] array using Convert.FromBase64String(). Somehow, that padded the extra byte, and decryption worked.

It's the small things in life...and it's only $64 because it took 16 hours and that's what my $4/hr (that I'm worth) converted to ;-).