base64 command on macOS returns wrong result
Decoding dXNlcm5hbWU6cGFzc3dvcmQK
gives username:password\n
.
So my guess is that in both cases, you have a linefeed you weren't expecting. The testin.txt
case is easy to solve (modify file, remove linefeed).
I expect the base64 case can be solved by using echo with the -n parameter to remove the linefeed:
echo -n username:password | base64 --encode