Hey folks, I know we like encoding urls with base64 to keep the automated bots off our hindquarters, I figured out a neat little trick. As I’m sure you are aware, you can share a torrent with the infohash only, without the need to have all the formatting of a magnet link.

The infohash is a 20 byte string represented with hexadecimal, and can be stored as both its ascii string or as just bytes. The interesting thing about base64 is that not only can it be used to encode an ascii string, it can also be used to encode bytes.

As an example, I’m going to use an archive.org torrent, using cryptii.com as the translator, since it allows me to encode bytes. So, we start with our infohash 62ae55f2329e29f79a8d1ed245c84818b5cf84e9 and we’re going to set cryptii to encode to base64, with our input view set to bytes grouped by ‘none’. Out of this, we get Yq5V8jKeKfeajR7SRchIGLXPhOk= Simply mirror the process for decoding.

This produces a base64 string which is actually shorter than the original infohash! This process always seems to produce the = at the end, which does make this unmistakably base64, but if encoded with the base64url standard this will disappear.

I thought this would probably be useful for the future when infohashes get shared on here, just in case automated bots start looking for infohash sized hexadecimal length strings.

@magmaus3@szmer.info
link
fedilink
English
21Y

That’s an interesting idea, but what if magnet link parts were added as well? For example trackers, like MeowdyPardner@kbin.social suggested, could be added like in a base64 string ( infohash + tracker URLs ).

I also made a page that converts infohashes to base64, like in your post. https://magmaus3.codeberg.page/infohash2base64

@toxictenement@lemmy.dbzer0.com
creator
link
fedilink
English
21Y

That script makes this a lot more convenient, thank you. As far as adding trackers, I’m not sure if there would be a way to compress them, which is what I was going for with the infohash encoding. If you try to encode a whole magnet link in base64, it ends up being a mile long with all the trackers added in (most of which do not connect). You could just encode the infohash of the magnet, but thats going to kind of defeat the point and confuse people. I don’t notice a difference most of the time with or without trackers, but if you need them, you can set qbittorrent to automatically appened trackers to torrents.

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ
!piracy@lemmy.dbzer0.com
Create a post
⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don’t request invites, trade, sell, or self-promote

3. Don’t request or link to specific pirated titles, including DMs

4. Don’t submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-Fi Liberapay
Ko-fi Liberapay

  • 1 user online
  • 101 users / day
  • 251 users / week
  • 978 users / month
  • 3.47K users / 6 months
  • 1 subscriber
  • 3.4K Posts
  • 82.3K Comments
  • Modlog