Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.
/ enc2file Public archive

Small module to easily encrypt and decrypt strings using cryptography's Fernet recipe.

Notifications You must be signed in to change notification settings

lfir/enc2file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enc2File module.


What is Enc2File?

Small module to easily encrypt and decrypt strings from stdin and files using cryptography's Fernet recipe.

Check cryptography docs for details on the ecryption used.


Requirements.

  • Python 3.6.
  • Cryptography 2.1.4.

Installation.

  1. git clone https://github.com/Asta1986/enc2file.git
  2. cd enc2file
  3. pip install .

To uninstall it: pip uninstall enc2file


Usage

Most importantly, to decrypt a string the encryption key and encoding have to be the same as those used to encrypt it. UTF-8 is used by default.

Example 1. Store an encrypted string in one file and the encryption key used in a different one.

import enc2file

enc = enc2file.Enc2File()
enc.enc2file('a_test_string', '/dir/msg.file')
enc.key_to_file('/dir/key.file')

Example 2. Read an encrypted string from file and print it.

import enc2file

enc = enc2file.Enc2File()
enc.key_from_file('/dir/key.file')
decypted_string = enc.decrypt_from_file('/dir/msg.file')
print(decypted_string)

On the command line 'enc2file --help' can be used to see the available terminal commands.

About

Small module to easily encrypt and decrypt strings using cryptography's Fernet recipe.

Resources

Stars

Watchers

Forks

Languages