--- id: twofish version: "0.3.0" license: 3-clause BSD license_treatment: permissive maintenance: abandoned --- # twofish — Bindings for the Twofish implementation by Niels Ferguson License: permissive · Maintenance: abandoned · Downloads: 462.6K/mo ## What it is and what it does Twofish is a Python wrapper around the Twofish block cipher, a symmetric encryption algorithm designed by Niels Ferguson. It exposes a simple API: create a Twofish instance with a binary key (0–32 bytes), then call encrypt() and decrypt() on 16-byte blocks. The library performs a self-test on import to verify the underlying C implementation. This is a low-level cryptographic primitive, not a complete cipher system. The documentation explicitly warns that it must be used within a proper cipher mode (CTR, CBC, etc.) to be secure; using it directly on plaintext is cryptographically unsafe. The package is unmaintained since 2013 and archived, with no support for modern Python versions beyond 3.3. Use it for: - Legacy system integration where Twofish is mandated by existing protocols or data formats - Educational exploration of block cipher mechanics and symmetric encryption primitives - Decryption of historical data encrypted with Twofish in a supported cipher mode ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python bindings to the Twofish block cipher for encrypting and decrypting 16-byte blocks with keys up to 32 bytes. No. The package is abandoned, unmaintained since 2013, and documented only for end-of-life Python versions (2.6–3.3). Modern Python compatibility is unverified. High install friction (compiled C extension + system library) and the explicit warning that it requires external cipher-mode wrapping make it unsuitable for new projects. Use a maintained cryptography library like cryptography or PyCryptodome instead. ## Install pip install twofish uv add twofish poetry add twofish ## Installing twofish Before you install: High install friction: the package requires a compiled C extension and the libtwofish-dev system library. The project is archived and unmaintained since 2013, with no updates for over a decade. Compatibility claims are limited to Python 2.6, 2.7, and 3.3—all end-of-life versions. License in practice: Licensed under 3-clause BSD (permissive), allowing commercial and private use with attribution and liability disclaimer. No restrictions on redistribution or modification. Quickstart: pip install twofish from twofish import Twofish T = Twofish(b'*secret*') encrypted = T.encrypt(b'YELLOWSUBMARINES') decrypted = T.decrypt(encrypted) Requires libtwofish-dev system library installed; high compilation friction. Designed for Python 2.6–3.3; compatibility with modern Python versions is unverified. Verify before relying: - Whether the package compiles and runs on Python 3.8 or later (only 3.3 is documented) - Current status of the underlying Niels Ferguson Twofish implementation and any known cryptographic weaknesses - Whether libtwofish-dev is available in current Linux distributions or requires manual installation ## Package facts - License: 3-clause BSD (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 462.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags twofish encryption python, block cipher bindings, symmetric key cryptography, twofish decrypt encrypt, cryptographic library python, niels ferguson twofish, abandoned, legacy-crypto [View on SkillFed](https://skillfed.io/packages/twofish) · [View on PyPI](https://pypi.org/project/twofish/)