Skip to main content

vorn (Python)

Experimental research cipher. Not reviewed by third parties. Do not use it to protect real secrets. For real use, take AES-GCM or ChaCha20-Poly1305 from the cryptography package.

Vorn-2 is an authenticated cipher (AEAD): a duplex sponge over a 512-bit ARX permutation with prime-hopping round constants. Pure Python, no dependencies, Python 3.10+. JavaScript and Rust implementations produce identical results.

Install

pip install vorn

Password mode

from vorn import encrypt, decrypt, VornError

blob = encrypt("hello", "correct-horse-battery-staple")                 # bytes
text = encrypt("hello", "correct-horse-battery-staple", armor=True)     # base64url str

try:
    print(decrypt(blob, "correct-horse-battery-staple"))   # b'hello'
    print(decrypt(text, "correct-horse-battery-staple"))
except VornError:
    print("wrong password or modified data")
  • Data may be str (UTF-8) or bytes.
  • aad=b"context" adds authenticated, unencrypted associated data.
  • The key comes from scrypt (default log_n=16, r=8, p=1, about 0.25 s). Tune with log_n=, r=, p=.
  • Output layout: "VRN2" | log2(n) | r | p | salt(16) | nonce(16) | ciphertext | tag(16); the whole header is authenticated. Decryption refuses scrypt settings above 512 MiB.

Raw AEAD

import os
from vorn import seal, unseal

key, nonce = os.urandom(32), os.urandom(16)      # never reuse a (key, nonce) pair
sealed = seal(key, nonce, b"payload", b"header")  # ciphertext || 16-byte tag
unseal(key, nonce, sealed, b"header")             # raises VornError if anything was changed

Performance and limits

About 380 kB/s (1 MB in 2.6 s). Meant for small payloads; use the Rust or JavaScript implementation for speed. Not constant-time, no memory wiping.

Version note

vorn 0.1.0 used an unrelated, broken construction. Do not use it. 0.2.x is a complete redesign and is not compatible with it.

License

MIT

Metadata

Release files for vorn 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vorn 0.2.4
File Size Uploaded Provenance Actions
vorn-0.2.4.tar.gz 9.6 kB Without provenance Details for vorn-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vorn 0.2.4
File Interpreter ABI Platform Actions
vorn-0.2.4-py3-none-any.whl Python 3 none any Details for vorn-0.2.4-py3-none-any.whl

Total release size: 16.3 kB

Release files / vorn-0.2.4.tar.gz

Download URL vorn-0.2.4.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
18d933012e49330bc61d6ee328647eb573ff2af430df79e483cdcc8f42f20fab
BLAKE2b-256 checksum
How to use checksums
4a101ba1d38f5af10c5985cfa82d3f87a960d177d9e1bed33467c9e1ec488e11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / vorn-0.2.4-py3-none-any.whl

Download URL vorn-0.2.4-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5685d7b2c5c36208ac1e9daa4fbb094d7492dd6f108b185ae88a032fd3cbc9ba
BLAKE2b-256 checksum
How to use checksums
acc06bf9309998db7c6388267046763062ccb4d70ba5944938810e0413748e53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for vorn 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page