Just a note with the Bash encoding method. It should be with the -n option:
$ echo -n "abcde" |base64
Otherwise, without the -n, echo injects an extra newline character to the end of the string that would become encoded.