Subject: Re: bug#28942: base64 decoding issue

From: Assaf Gordon <[email-masked]>
Date: Mon, 29 Oct 2018 19:40:57 -0600

tags 28942 notabug
close 28942
stop

(triaging old bugs)

On 2017-10-22 10:13 a.m., Aaron Schneider wrote:
  I try to decode the "thunder://" link to the "magnet://" link using 
base64.  For me, it adds 'AA' at the beginning (0x4141) which shouldn't 
be there.
> 
> * Website:
> ------
> thunder://QUFtYWduZXQ6P3h0PXVybjpidGloOmY5YWFkZDYxY2EzM2ZkMWQwYzQ3Mjk2MTQwZTg4ZmFmMWYzZGQyYTJaWg==
> ------
> magnet:?xt=urn:btih:f9aadd61ca33fd1d0c47296140e88faf1f3dd2a2
> 
> 
> * My base64 (happens on all versions I've tried):
> echo QUFtYWduZXQ6P3h0PXVybjpidGloOmY5YWFkZDYxY2EzM2ZkMWQwYzQ3Mjk2MTQwZTg4ZmFmMWYzZGQyYTJaWg== | base64 -d
> AAmagnet:?xt=urn:btih:f9aadd61ca33fd1d0c47296140e88faf1f3dd2a2ZZ
> 

It seems your message was lost and not replied to in a eyar.
Sorry about that.

If you try to encode the "magnet://" string to base64,
you'll get:

$ echo "magnet:?xt=urn:btih:f9aadd61ca33fd1d0c47296140e88faf1f3dd2a2" \
    | base64 -w0 ; echo
bWFnbmV0Oj94dD11cm46YnRpaDpmOWFhZGQ2MWNhMzNmZDFkMGM0NzI5NjE0MGU4OGZhZjFmM2RkMmEyCg==

Which means your encoded string (the one starting with "QUF") is
not identical to the encoded "magnet://" string.

As such, I'm closing this bug.
If this is still an issue, discussion can continue by replying to this 
thread.

-assaf