Skip to main content

No project description provided

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtwine-1.0.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

xtwine-1.0.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file xtwine-1.0.2.tar.gz.

File metadata

  • Download URL: xtwine-1.0.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for xtwine-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9084af53b55d4d66626b328a4d4105a3307f321adfd6bf24d61e52f085ceaa16
MD5 e46513449ca524a8ddfbe4c8bd487b0b
BLAKE2b-256 b5db6f4f1b09b28d604e59d34d821558afb2563a1dac4b89893ae22c2a8d6d06

See more details on using hashes here.

File details

Details for the file xtwine-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: xtwine-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for xtwine-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 155277955b124373a1c0522f1dcd04270bacae7d48424e96e9141995e3b6fa41
MD5 b6d022d7a40bf338a8b5c78da7e34e40
BLAKE2b-256 3c216ac4f4d0d5ba9bf70e598c806c1753dcdbb1122cd911a231530f72f59af3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page