Skip to main content

TWINE: A Lightweight Block Cipher for Multiple Platforms

This repository is an implementation of TWINE: A Lightweight Block Cipher for Multiple Platforms paper introduced by Tomoyasu Suzaki, Kazuhiko Minematsu, Sumio Morioka, and Eita Kobayashi.

Installation

Install by pip from PyPI:

pip3 install twine

Or install latest version from github:

python3 -m pip install -U git+https://github.com/amoallim15/TWINE.git

Usage

This repository contains a command line tool that can be used to ecnrypt plaintext samples using either of the supported 80 bits or 128 bits sized keys.

Example 1:

xtwine "hello world" -k "<o8~I{?3Uz"

The output:

Encryption Key: "<o8~I{?3Uz"
abb90d4c0a8f67632cec7c01ee409ea1

Example 2:

xtwine "01bbed92bccc2104b7e12141f1413ad6" -d -k "4ejqxfDL3#"

The output:

Decryption Key: "4ejqxfDL3#"
hello world

Example 3:

xtwine "1 plus 1 equals 2"

The output:

Encryption Key: "8_D]H[!^M*"
0315a70682ac625cdced6a7ff834d629c2b70de4e2d1fc7b

Example 4:

xtwine "1 plus 1 equals 2" -z 128

The output:

Encryption Key: "oti,D:H6[5WX|8jS"
7f9c4394decc4c59c94be30b49db5ef66943a2938416382f

Example 5:

    from xtwine import Twine

    twine = Twine(key_size=0x50)
    # If the key param is not specified
    # it will generate a key automatically.
    ciphertext = twine.encrypt("hello world")
    print(ciphertext) # > "abb90d4c0a8f67632cec7c01ee409ea1"
    plaintext = twine.decrypt(ciphertext)
    print(plaintext) # > "hello world"

Release History

  • 1.0.2

    • hotfix: from xtwine import Twine
  • 1.0.1

    • read/write from/to stdin/stdout.

About

Ali Moallim

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/amoallim15/xtwine. I'm also available for questions, feel free to get in touch.

License

This code is licensed under MIT.

License: MIT

Metadata

Release files for xtwine 1.0.2

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

Source distribution (sdist)

Source distribution for xtwine 1.0.2
File Size Uploaded Provenance Actions
xtwine-1.0.2.tar.gz 5.9 kB Without provenance Details for xtwine-1.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 11.8 kB

Release files / xtwine-1.0.2.tar.gz

Download URL xtwine-1.0.2.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9084af53b55d4d66626b328a4d4105a3307f321adfd6bf24d61e52f085ceaa16
BLAKE2b-256 checksum
How to use checksums
b5db6f4f1b09b28d604e59d34d821558afb2563a1dac4b89893ae22c2a8d6d06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release files / xtwine-1.0.2-py3-none-any.whl

Download URL xtwine-1.0.2-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
155277955b124373a1c0522f1dcd04270bacae7d48424e96e9141995e3b6fa41
BLAKE2b-256 checksum
How to use checksums
3c216ac4f4d0d5ba9bf70e598c806c1753dcdbb1122cd911a231530f72f59af3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Security for xtwine 1.0.2

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

1.0.2 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