Base64 encode/decode: use Buffer 'binary' encoding
Base64 encode/decode: use Buffer 'binary' encoding

Buffer 'binary' encoding treats Unicode U+80..U+FF (Latin 1 Supplement)
characters as 8-bit characters, hence 'binary' encoding operates equivalently to
btoa() / atob().

Once a string has been UTF-8 encoded, it is effectively a sequence of 8-bit
characters.

Buffer 'utf8' encoding treats Unicode U+80..U+FF characters as UTF-8 escape
sequences; hence where Buffer('ça','binary').toString('base64') gives '52E='
(same as btoa('ça'), Buffer('ça','utf8').toString('base64') gives 'w6dh', as
does Buffer('Ã§a','binary').toString('base64'), 'Ã§a' being the UTF-8 encoded
equivalent of 'ça'.

This commit enables the AES encryption/decryption to enteroperate between client
and server.

chrisveness/crypto