The base64 string ADEwNjcANDEzNDgxODdCNjcyNzIxMzU5NjU1M0VBM0JFOEE5QzM=
when decoded is 106741348187B6727213596553EA3BE8A9C3
. When I encode 106741348187B6727213596553EA3BE8A9C3
to base64 the result is MTA2NzQxMzQ4MTg3QjY3MjcyMTM1OTY1NTNFQTNCRThBOUMz
.
I'm certain that the un-encoded string is the input for the first base64 string because the un-encoded string is made up of a user id and an authorization token joined. So if decoding from base64 gives me these two specific strings joined, but encoding results in something different from the string from which they were decoded, how exactly was the un-encoded string encoded to the base64 string to begin with?
The problem is that the result of decoding your input isn't
106741348187B6727213596553EA3BE8A9C3
; it's\01067\041348187B6727213596553EA3BE8A9C3
. Note the two null bytes, which are presumably getting stripped before you re-encode it.If you decode and re-encode without stripping those nulls, you get the input back:
To better see what's going on, look at the actual bytes being output by your decoder: