Go to file
2022-08-24 15:42:24 -05:00
onioncompressor initial commit 2021-08-27 06:14:04 +00:00
tests initial commit 2021-08-27 06:14:04 +00:00
.gitignore initial commit 2021-08-27 06:14:04 +00:00
.travis.yml initial commit 2021-08-27 06:14:04 +00:00
CHANGELOG.md initial commit 2021-08-27 06:14:04 +00:00
LICENSE initial commit 2021-08-27 06:14:04 +00:00
Makefile initial commit 2021-08-27 06:14:04 +00:00
README.md Fix readme 2022-08-24 15:42:24 -05:00
requirements.in initial commit 2021-08-27 06:14:04 +00:00
requirements.txt initial commit 2021-08-27 06:14:04 +00:00
run_tests.sh initial commit 2021-08-27 06:14:04 +00:00
setup.py initial commit 2021-08-27 06:14:04 +00:00

OnionCompressor

Per v3 Tor onion spec: https://github.com/torproject/torspec/blob/main/rend-spec-v3.txt

This small module 'compresses' v3 onions by decoding the base32, removing the non-security related checksum, and removing the version number.

The resulting bytes is actually a valid ed25519 public key, but you probably shouldn't use it for anything but normal Tor onion uses.

It can also uncompress the bytes back to the human friendly format.

The compressed result is about 50% smaller.

Usage

compressed: bytes = onioncompressor.compress('duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion')

uncompressed: str: = onioncompressor.decompress(compressed)