Skip to main content

Encrypting piped data with AES

Project description

AES Pipe

This application/library is for encrypting piped data and was mainly developed to be used with limittar for space efficient data encryption using pipes to remove the need for temporarily storing the potentially large archives and encrypted data.

Requirements

  • Python 3
  • PyCrypto

Installation

From the Python Package Index:

pip install aes-pipe

Or download and run:

python3 setup.py install

Usage

Use the -h argument for help:

aes-pipe -h

Encrypting data

If no key command is specified, the user is prompted for a passphrase.

cat something.tar | aes-pipe > encrypted_tar

Encrypting files spanned across multiple Blu-Ray discs

find /path/photos/ -print0 > files

limittar -0 -i files -l remaining1 -s 25025314784 | aes-pipe | cdrskin -v driveropts=burnfree -tao dev=/dev/sr0 -
limittar -0 -i remaining1 -l remaining2 -s 25025314784 | aes-pipe | cdrskin -v driveropts=burnfree -tao dev=/dev/sr0 -
...

As the remaining file list is output before the encryption ends, multiple discs can be written to at once.

Note that aes-pipe.py prepends a 32 byte nonce to the encrypted output data in this case which needs to be calculated into the size limit of the tar.

Decrypting files from discs

Using the Blu-Ray discs created in the example above, the following line can be run for each disc.

cat /dev/sr0 | aes-pipe -d | tar -xf -

Files will be output with their original paths.

Decrypt only specific files and directories

This is useful for recovering deleted items from a backup. Until the items are found, this will need to be run on each storage area across which the encrypted data was spanned.

cat /dev/sdX | aes-pipe -d | tar -C path/to/output/dir/ -xf - "path/of/dir in archive/" path/of/a_file.png

Encryption with a GPG public key

Output encrypted key file

cat something.tar | aes-pipe -c "gpg --output encrypted_key.gpg --encrypt --recipient email@example.com" > encrypted_tar

This pipes the encryption key and nonce to the gpg application. This also means that the nonce is not prepended to the encrypted output which means the output data size is the same as the input data size.

Use encrypted key file

cat encrypted_tar | aes-pipe -d -c "gpg --decrypt encrypted_key.gpg" > something.tar

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

aes-pipe-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aes_pipe-1.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file aes-pipe-1.0.0.tar.gz.

File metadata

  • Download URL: aes-pipe-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for aes-pipe-1.0.0.tar.gz
Algorithm Hash digest
SHA256 11836af9ab826fca66d160deb2d5a4d27c2fd3c42498a859456b96c0cdae22e9
MD5 3e3f7f811d084bc16f0743be2d47abbb
BLAKE2b-256 9df101126b37cc13d208985b408745a74f5d7a20b98cd08eae14989430853a6f

See more details on using hashes here.

File details

Details for the file aes_pipe-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: aes_pipe-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for aes_pipe-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59d0d1b078939ffebdacd6ae1a3a0ed38678fded14d91dee5897fbf146a89268
MD5 437adba3cd418b3142e0d1a2eaef512f
BLAKE2b-256 f207b29b0e6300ec7b1d8150f914f7243294a747ba320d2367347c39adaed933

See more details on using hashes here.

Supported by

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