Skip to main content

Encrypt file using fernet

Project description

Encrypter

This package contains 2 main functions for Encrypting and Decrypting a file. encrypt_file() creates an encrypted copy of a file using Fernet (symmetric encryption) in the working directory. The function takes a file as main argument and a key_file as optional argument. If no key_file is given, then a key for the encryption is created using Fernet.generate_key()

decrypt_file() is used for decrypting the file generated by the previous function. It requires the encrypted file and the key generated (or used) during the encryption process.

Installation

To install run the following:

pip install encrypter-fernet-dr

Usage

from encrypter_fernet_dr import encrypt_file

# generate key and encrypted copy of my_file in the working directory
encrypt_file('my_file')
from encrypter_fernet_dr import decrypt_file

# decrypt the file passing the key generated or used before
decrypt_file('my_file_encrypted', 'my_key')

Developing Encrypter

To install encrypter, along with the tools needed to develop and run tests, run the following in your virtualenv:

$ pip install -e .[dev]

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

encrypter_fernet_dr-0.0.2.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

encrypter_fernet_dr-0.0.2-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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