Skip to main content

Mix&Slice

Project description

Description

https://travis-ci.org/unibg-seclab/aesmix.svg?branch=master

This directory contains the python wrapper based on cffi and the command line tool to use Mix&Slice on your files.

The C implementation has been built with performance in mind, whereas the python wrapper and the CLI tool has been implemented to offer a more widespread access of the Mix&Slice capabilities. The mixing and slicing phases use the C implementation, but the python conversion adds a big overhead since it has to materialize all the buffers in memory.

Since the tool materializes all the buffers in memory and has to perform both the mixing and the slicing phases, you should only use the CLI tool on files that are at maximum as large as a third of your available memory.

Please check the file example.py to understand how to use the library.

Requirements

Before proceeding please install the openssl/crypto library source. In ubuntu you can proceed as follows:

sudo apt install libssl-dev

Installation

The package has been uploaded to PyPI so, after installing the requirements, you can install the latest released version using pip:

pip install aesmix

To install the version from this repository, you can use the commands:

make build
sudo make install

To install the package in a virtual environment, use:

python setup.py install

The python wrapper will also compile the libaesmix library.

Command Line Interface

This package also installs the mixslice tool that can be used as follows.

To encrypt a file:

$ mixslice encrypt sample.txt
INFO: [*] Encrypting file sample.txt ...
INFO: Output fragdir:   sample.txt.enc
INFO: Public key file:  sample.txt.public
INFO: Private key file: sample.txt.private

To perform a policy update:

$ mixslice update sample.txt.enc
INFO: [*] Performing policy update on sample.txt.enc ...
INFO: Encrypting fragment #68
INFO: Done

To decrypt a file:

$ mixslice decrypt sample.txt.enc
INFO: [*] Decrypting fragdir sample.txt.enc using key sample.txt.public ...
INFO: Decrypting fragment #68
INFO: Decrypted file: sample.txt.enc.dec

$ sha1sum sample.txt sample.txt.enc.dec
d3e92d3c3bf278e533f75818ee94d472347fa32a  sample.txt
d3e92d3c3bf278e533f75818ee94d472347fa32a  sample.txt.enc.dec

Key regression mechanism

The key regression mechanism implementation is based on “Key Regression: Enabling Efficient Key Distribution for Secure Distributed Storage”.

Example

The key regression library can be used as follows.

from aesmix.keyreg import KeyRegRSA


iters = 5
stp = KeyRegRSA()

print("== WINDING ==")
for i in range(iters):
    stp, stm = stp.wind()
    print("k%i: %r" % (i, stm.keyder()))

print("\n== UNWINDING ==")
for i in range(iters - 1, -1, -1):
    print("k%i: %r" % (i, stm.keyder()))
    stm = stm.unwind()

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

aesmix-1.6.tar.gz (14.7 kB view details)

Uploaded Source

File details

Details for the file aesmix-1.6.tar.gz.

File metadata

  • Download URL: aesmix-1.6.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for aesmix-1.6.tar.gz
Algorithm Hash digest
SHA256 0075721efb2a091f3ee822ff3e3a8412134ec239e11a238fab905b91d4485daa
MD5 94f9ec4830c7858a6e51ff88aafeb18b
BLAKE2b-256 263990fbca4528501f30d0b6641a4d1fb4a26334593582d99dae6614c8f618e2

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