Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twofish

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twofish

Bindings for the Twofish implementation by Niels Ferguson

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
2

python-twofish

Bindings for the Twofish implementation by Niels Ferguson libtwofish-dev_.

Compatible with Python 2.6, 2.7 and 3.3.

The library performs a self-test at each import.

.. _libtwofish-dev: http://packages.debian.org/sid/libtwofish-dev

Installation

::

pip install twofish

Usage

Create a twofish.Twofish instance with a key of length ]0, 32] and then use the encrypt and decrypt methods on 16 bytes blocks.

All values must be binary strings (str on Python 2, bytes on Python 3)

[WARNING] this should be used in a senseful cipher mode, like CTR or CBC. If you don't know what this mean, you should probably usa a higher level library.

Example

from twofish import Twofish T = Twofish(b'secret') x = T.encrypt(b'YELLOWSUBMARINES') print(T.decrypt(x).decode()) YELLOWSUBMARINES

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc