> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/encoding-and-decoding/basex/base58.md).

# Base58

Base58 is similar to Base64, but modified to avoid both non-alphanumeric characters (+ and /) and letters that might look ambiguous when printed (0 – zero, I – capital i, O – capital o and l – lower-case L). Base58 is used to represent [bitcoin](https://en.wikipedia.org/wiki/Bitcoin) addresses.

## Convert in bash

You can decode base58 wirh the `base58` command in bash from the `base58` package.\
Use `sudo apt install base58` if needed.

```bash
┌──(kali㉿kali)-[/mnt/…/TryHackMe/CTFs/Easy/CTF_Collection_Vol.1]
└─$ echo '3agrSy1CewF9v8ukcSkPSYm3oKUoByUpKG4L' | base58 -d
THM{17_h45_l3553r_l3773r5}    
```

## Convert with Binary Refinery

You can convert from `base58` with [b58](https://binref.github.io/#refinery.b58) from Binary Refinery

```bash
┌──(kali㉿kali)-[~]
└─$ source ~/Python_venvs/Binary_Refinery/bin/activate

┌──(Binary_Refinery)─(kali㉿kali)-[~]
└─$ emit '3agrSy1CewF9v8ukcSkPSYm3oKUoByUpKG4L' | b58
(12:04:54) warning in b58: very long alphabet, unable to use built-ins; reverting to (slow) fallback.
THM{17_h45_l3553r_l3773r5}
```

## Convert with online services

You can also decode base58 with one of these online services:

Code Beautify: <https://codebeautify.org/base58-decode>

CyberChef: <https://gchq.github.io/CyberChef/#recipe=To_Base58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz')>

dcode.fr: <https://www.dcode.fr/base-58-cipher>

## Resources

Binary Refinery - Documentation: <https://binref.github.io/>

Binary Refinery - GitHub: <https://github.com/binref/refinery/>
