Metadata-Version: 2.4
Name: remailers
Version: 0.1.0a2
Summary: PGP anonymous-message (nym/remailer) toolkit over Usenet and Tor email.
Author-email: JarbasAi <jarbasai@mailfence.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/JarbasAl/remailers
Keywords: remailer,nym,anonymity,pgp,usenet,mixmaster,hsub,esub
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications :: Email
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pycryptodomex
Requires-Dist: PGPy
Requires-Dist: dateparser
Requires-Dist: PySocks
Requires-Dist: requests
Requires-Dist: usenet
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

# remailers

A toolkit for **anonymous messaging** with PGP over Usenet and Tor email:
hashed/encrypted subjects (hSub/eSub), nym-server (ZAX) registration, and
SOCKS/Tor SMTP. Built on top of [`usenet`](https://github.com/JarbasAl/usenet).

> For research and privacy education. The public nym/remailer network is largely
> historical. Treat the bundled server definitions as starting points.

## Install

```bash
pip install remailers
```

## Quickstart

Generate (or load) a PGP identity:

```python
from remailers import Credentials

creds = Credentials("my_key.asc", name="PythonicAnon")
print(creds.pubkey)
```

Hashed and encrypted subjects: let a recipient spot a message meant for them
without revealing the subject:

```python
from remailers import create_hsub, match_hsub, create_esub, match_esub

hsub = create_hsub("evil dolphin captain")
assert match_hsub(hsub, "evil dolphin captain")

esub = create_esub("evil dolphin captain", key="shared-secret")
assert match_esub("evil dolphin captain", "shared-secret", esub)
```

Post and retrieve anonymous messages via `alt.anonymous.messages`:

```python
from usenet import UsenetServer
from remailers import Credentials, AnonBox, create_hsub

creds = Credentials("my_key.asc")
hsub = create_hsub("evil dolphin captain")
ciphertext = creds.encrypt("meet at noon")

with UsenetServer("news.neodome.net") as server:
    server.post(ciphertext, hsub, "alt.anonymous.messages")

inbox = AnonBox(creds, UsenetServer("news.neodome.net"))
for article in inbox.retrieve_by_subject("evil dolphin captain"):
    print(article.text)
```

ZAX nym servers and Tor email are in `remailers.zax` and `remailers.mail`. See
`examples/`.

## Security notes

- Initialization vectors come from `os.urandom` (`remailers.utils.generate_iv`).
- hSub uses SHA-256. eSub uses Blowfish for Type-I compatibility: it exists for
  interop with the legacy remailer ecosystem, not as modern AEAD.
- Message bodies are protected by PGP (RSA-4096, AES-256), not by the subject
  scheme.

## Testing

```bash
pip install -e .[test]
pytest test/
```

Tests are offline: subject round-trips, IV entropy, and a PGP encrypt/decrypt
cycle with a freshly generated key.

## License

Apache-2.0
