Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyFileSec

pyFileSec provides robust yet easy-to-use tools for working with files that may contain sensitive information. The aim is to achieve an “industry standard” level of strong privacy, capable of protecting confidential information from inspection or accidental disclosure. Integrity assurance may be useful in archival and provenance applications.

Overview

The motivation for developing pyFileSec is to better secure research data obtained from human subjects, e.g., in combination with PsychoPy (http://www.psychopy.org) or the Open Science Framework (http://www.openscienceframework.org). The hope is that pyFileSec will be more widely useful. For example, command-line options make it accessible from non-python or non-open-source programs.

Several truly excellent Python packages are available for encryption. However, file security requires more than just good encryption, e.g., securely deleting a file after encryption. The main and potentially unique contribution of pyFileSec is that it aspires to provide cross-platform, secure file-management with a low barrier to entry and a stable API going forward. These considerations motivate many of the design choices.

The main functions provided include encryption (encrypt, decrypt, rotate) and verification (sign, verify). It is also easy to obscure file length (pad, unpad), securely remove files from disk (destroy) and inspect meta-data (.metadata). Large files (tested up to 8G) and command-line usage are also supported. By default, file permissions are set to conservative values (only Mac & linux at this point). Unencrypted files are deleted securely after a successful encryption. Multiple hardlinks, version control, and Dropbox folders are detected and reported.

pyFileSec provides the class SecFile, which is designed to be easy to use:

>>> import pyfilesec as pfs
>>> sf = pfs.SecFile('data.txt')
>>> sf.encrypt(path_to_pubkey)

Public-key (asymmetric) encryption is used for security and flexibility, currently relying on calls to OpenSSL for all cryptography. The aim is to provide a robust and easily extensible framework for adding other encryption backends, without requiring changes to the API.

Bug reports and code contributions are welcome; the project is on github and you can contact me there. Help with Windows file permissions would be particularly welcome (see the issues list). For contacting me privately, e.g., about security issues, please look for my email address at the top of the main code.

Software that includes pyFileSec

  • PsychoPy, as of v1.79.00 (forthcoming)

Contributors

Jeremy R. Gray - package creator and maintainer (GPG key D934B0D7)

Michael Stone - awesome code review

Sol Simpson - Windows compatibility

Milestones

  • 0.2 class SecFile (available in v0.2.10alpha)

  • 0.3 Python 3 (2to3 mostly passes now)

  • 0.4 An alternative encryption backend (possibly pyCrypto and gpg support)

  • 0.5 Windows file-permissions

Dev branch status

This status information concerns the master branch of the source code on github. Pypi releases are made from time to time, based on stable points in the development code.

https://travis-ci.org/jeremygray/pyfilesec.png?branch=master https://coveralls.io/repos/jeremygray/pyfilesec/badge.png?branch=master

See also

  • pyCrypto, M2Crypto, pyOpenSSL - broad crypto packages, few sys-admin features

  • pycogworks.crypto - similar audience as pyfilesec, no file encryption

  • Ephemeral - encrypted temporary files

Metadata

Release files for PyFileSec 0.2.11alpha

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

Source distribution (sdist)

Source distribution for PyFileSec 0.2.11alpha
File Size Uploaded Provenance
PyFileSec-0.2.11alpha.tar.gz 80.1 kB Without provenance Details

Release files / PyFileSec-0.2.11alpha.tar.gz

Download URL PyFileSec-0.2.11alpha.tar.gz
Size 80.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2971349305d1f4a48debe2115b57efa20241cb78d1919c078c3db12ca89996c6
BLAKE2b-256 checksum
How to use checksums
5d5398da0f247d445f178aebc5f5df4cafdb6a41df91097c7345e5d5b7f5079a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for PyFileSec 0.2.11alpha

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.

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