This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
fileenc-openssl
---------------------------------------

This code allows one to easily encrypt and decrypt files symmetrically using openssl and python3.

* Uses ``aes-256-cbc`` for file encryption (as implemented by openssl)
* Uses a salt when encrypting (to avoid pre-computation or rainbow tables).
* Uses ``sha256`` key stretching (with <0.1s) to make brute force prohibitively expensive.
* Uses ``sha256`` checksum to check file integrity.

Installation
---------------------------------------

You can install using

.. code-block:: bash

pip install fileenc-openssl

If you want ``fileenc`` and ``filedec`` available system-wide, use ``sudo`` or equivalent.

Usage
---------------------------------------

From command line:

.. code-block:: bash

fileenc --key 'password123' --input '*.png' --check --overwrite
filedec --key 'password123' --input '*.png.enc' --check --overwrite --remove
# the quotes around wildcards are important

From python:

.. code-block:: python

from fileenc_openssl import stretch_key, encrypt_file, decrypt_file
stretched_key = stretch_key('password123')
enc_pth = encrypt_file(raw_pth, key=stretched_key)
res_pth = decrypt_file(enc_pth, key=stretched_key)

Testing (needs ``py.test``):

.. code-block:: bash

py.test

Options
---------------------------------------

You can find all options using ``fileenc --help``::

-h, --help show this help message and exit
-k KEY, --key KEY the key to use for encryption; you will be prompted for one if this is not provided (more secure)
-i INP, --input INP input file, directory or pattern (as a single string) (.enc will be appended)
-o OUTP, --output OUTP optionally, output file or directory (.enc will be stripped if available)
-d, --decrypt decrypt the input file(s) (as opposed to encrypt, which is the default)
-f, --overwrite overwrite existing files when decrypting (encrypting always overwrites)
-r, --remove remove the input file after en/decrypting (after --check)
-c, --check test the encryption by reversing it (abort on failure) (only for ENcryption due to salting)
-1, --once prompt for the key only once (when encrypting without -k)
-j N, --process-count N number of parallel processes to use for en/decryption; `0` for auto (default), `1` for serial


optional arguments:
-h, --help show this help message and exit
-k KEY, --key KEY the key to use for encryption; you will be prompted
for one if this is not provided (more secure)
-i INP, --input INP input file, directory or pattern as a single string
(required for encrypting; defaults to *.enc when
decrypting)
-o OUTP, --output OUTP
optionally, output file or directory; .enc will be
appended to each file
-d, --decrypt decrypt the input file(s) (as opposed to encrypt,
which is the default)
-f, --overwrite overwrite existing files when decrypting (encrypting
always overwrites)
-r, --remove shred the input file after en/decrypting (after
--check)
-c, --check test the encryption by reversing it (abort on failure)
(only for ENcryption due to salting)
-1, --once prompt for the key only once (only applicable if --key
and --decrypt are not set)
-j PROC_CNT, --process-count PROC_CNT
number of parallel processes to use for en/decryption;
`0` for auto (default), `1` for serial


License
---------------------------------------

Revised BSD License; at your own risk, you can mostly do whatever you want with this code, just don't use my name for promotion and do keep the license file.
Release History

Release History

1.3.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fileenc_openssl-1.3.0-py2.py3-none-any.whl (9.8 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Sep 7, 2016
fileenc-openssl-1.3.0.tar.gz (6.1 kB) Copy SHA256 Checksum SHA256 Source Sep 7, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting