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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file encrypter_fernet_dr-0.0.2.tar.gz.

File metadata

  • Download URL: encrypter_fernet_dr-0.0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.1

File hashes

Hashes for encrypter_fernet_dr-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f03ba881953ccff9070fd89cadc8a6d54068b8e141122cf93a08714d6520e358
MD5 e4f1c0458f33476194d4e3619e5dc8f5
BLAKE2b-256 f926b37f0a1a8eed6be23cc021871b044cd1dedf539a858ecc97ea0be7a5d392

See more details on using hashes here.

File details

Details for the file encrypter_fernet_dr-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: encrypter_fernet_dr-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.1

File hashes

Hashes for encrypter_fernet_dr-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6479b8eea3040dd9a82810668e5a59a1510aaa0427073bda82cb82c10cd0fea
MD5 14a2bceae661285361d8830d2d33d036
BLAKE2b-256 6751f0e520cc70c49ee9aa8da3f71786380d5c2909b7ebc16521aebbef80a411

See more details on using hashes here.

Supported by

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