cobalt-green | 170 points
Edit: You should use HA5HBANG's version instead. Glad to see I'm not the only one who wanted something like this.
I thought you guys might like this
javascript:
var encoded = prompt("Input the Base64 text:");
try
{
var decoded = atob(encoded);
alert(decoded);
}
catch(error)
{
alert("Couldn't decode");
}
How to use it - https://my.mixtape.moe/bgvldc.mp4
[-] WifeKilledMy1stAcct | 6 points
For Chrome, there's this simple extension. It has decrypted all keys for me without even having to right-click or anything! https://chrome.google.com/webstore/detail/base64-encode-and-decode/kcafoaahiffdjffagoegkdiabclnkbha
[-] TJHookerWithAPenis | 4 points
I think an extension is more likely to affect browser performance, but it's good to know that exists.
[-] [deleted] | 3 points
This is nice. I've combined both versions by u/cobalt-green and u/HA5HBANG so you can edit both the input & output if need be:
javascript: var encoded = prompt("Input the Base64 text:"); try { var decoded = atob(encoded); prompt('Your decoded text:', decoded); } catch(error) { alert("Couldn't decode"); }
Click cancel when you're done copying/editing the decoded text, otherwise, you'll leave the page.
Click cancel when you're done copying/editing the decoded text, otherwise, you'll leave the page.
Nice job. To avoid the navigation problem, just assign the output of the prompt to a dummy variable:
javascript: var encoded = prompt("Input the Base64 text:"); try { var decoded = atob(encoded); var x=prompt('Your decoded text:', decoded); } catch(error) { alert("Couldn't decode"); }
Thank you! Small change: automatically copies highlighted text, allows editing.
javascript: var encoded = prompt("Input the Base64 text:",window.getSelection().toString()); try { var decoded = atob(encoded); var x = prompt('Your decoded text:', decoded); } catch(error) { alert("Couldn't decode"); }
Even better! I think we've arrived. This is probably the best general-purpose method.
I stand on the shoulders of giants. Thank you all.
[-] TJHookerWithAPenis | 1 points
Good work & thank you /u/HA5HBANG and /u/chagmed this is awesome. I was on this thread early and didn't see what teamwork and a little time would do to improve the script. So glad I came back to it. I would have half a mind to submit it to bestof if we weren't trying to keep a low profile.
[-] [deleted] | 2 points
Awesome thanks :)
[-] madwilliamflint | 2 points
Oh thank god you magnificent bastard. This shit should be gilded.
Woah sweet. If only it could somehow translate it on the page, haha
[-] thesunmustdie | 2 points
Easy enough to write an extension app that detects base-64 strings on Megalinks threads (using regex) and replaces it with decoded content — if you know some JavaScript. I might do it myself tomorrow if I have time, because it would be a pretty handy tool to have.
[-] douhaveanygreypoupon | 3 points
There was a bookmarklet posted for making plain-text mega ids/decryption keys into urls, you could probably use it as a base
[META] JavaScript bookmarklet to automatically link-ify MEGA IDs (and decryption keys if present)
[-] thesunmustdie | 1 points
Excellent. Thank you.
[-] [deleted] | 1 points
Thank you!
[-] 1231231231231232131 | 1 points
So you guys are trying to automatize the anti bot measurements. what could possibly go wrong...
Granted base64 is a retarded solution, and I've no idea why it was revived.
echo "passphrase" | base64 --decode
[-] thesunmustdie | 1 points
Playing devil's advocate:
"So you guys are trying to automatize the anti bot measurements"
We just need to stay one step ahead of them.
"what could possibly go wrong..."
The bots catch up and we modify the code slightly to compensate.
[-] madwilliamflint | 1 points
This will always be what happens. Always. It is the way of things.
I deleted my first comment accidentally. Here's the gist again:
IMO, I really don't think this helps bots. It's difficult to write general code to recognize base64 on a page, because the character set is just the alphabet in upper and lower case and a few extra characters. If someone does code a bot to recognize base 64 links, then converting those links into the proper format will be the simplest step of the code.
Providing a tool such as the one in this thread for easier
I would love to hear from others more knowledgeable than I.
[-] 1231231231231232131 | 1 points
true. People were claiming the sub is invested with bots. I still think it's manual labor, otherwise all the old posts would be affected as well, but there are year old uploads that still work fine. But who knows...
[-] MrTattyBojangles | 1 points
This and none of the ones in the comments seem to get the job done any faster, at least not for me. But I appreciate you all trying.
[-] HA5HBANG | 34 points | Sep 01 2017 22:57:39
I used to use something similar, but tweaked it to an
prompt
box instead of analert
. This lets you edit the link in place (to remove#Salt!
for instance, or whatever other crap our uploaders are putting in these links). It also gets the currently selected text on the page, so no need to copy and paste. Works in Chrome. Haven't tested in other browsers.edit: fixed. tnx u/cobalt-green!
permalink
[-] cobalt-green | 12 points | Sep 01 2017 23:20:17
Wow, that is much better! Turns two clicks into one and makes it easier to clean up the result. But I think you meant to put the var x before the prompt, not inside it.
permalink
[-] HA5HBANG | 2 points | Sep 02 2017 00:01:49
you're right, didn't look close enough when typing. thanks!
permalink
[-] sigtrap | 1 points | Sep 01 2017 23:24:14
Doesn't seem to work in Firefox.
permalink
[-] DV865 | 2 points | Sep 01 2017 23:38:52
Works fine in my Firefox v55.0.3
permalink
[-] HA5HBANG | 2 points | Sep 02 2017 00:03:50
There was a typo. Try it now?
permalink
[-] sigtrap | 2 points | Sep 02 2017 02:20:58
Yep now it works. Thanks
permalink
[-] Anaron | 1 points | Sep 02 2017 09:49:54
This is great. Thanks!
And thanks OP for the idea.
permalink
[-] chagmed | 1 points | Sep 02 2017 13:53:30
I'm missing something. If, e.g., I need to remove
2017
from the following L+K prior to decoding, how would I do that using the bookmarklet? I highlight, click the bookmarklet, and get the result. How do I remove the above salt prior to conversion?permalink
[-] HA5HBANG | 2 points | Sep 02 2017 14:51:35
The first step of this code is to convert selected text from base64. It needs to be proper base64, so if anyone puts extra characters in the middle of encoded text, it will produce partially garbled results. You'd have to edit the original text first to remove
2017
.edit: You'd have to use u/cobalt-green's original code because it lets you edit the text when inputting. Mine lets you edit the output. It would be easy enough to combine the code to allow editing at both ends.
permalink
[-] dylpickles1133 | 1 points | Oct 31 2017 14:45:31
First and foremost, this is awesome. Thank you for this.
I do have a question though. When decoding the link on this post, the result gives this weird "NL" at the end of the string. https://imgur.com/N6Sv6SV Any idea what this is or where it comes from? When I paste the deobfuscated link in the address bar, the "NL" disappears.
permalink
[-] HA5HBANG | 1 points | Oct 31 2017 15:14:22
It's a newline character. Very common to find these in base64 encoded text. There are some base64 encoders that always add a newline at the end of the text. Sometimes, it's the user's fault, ie the person encoding may select text and inadvertently select a newline before and/or after the intended text.
It can be annoying to look at, but harmless.
permalink