Skip to content

https-sam/files-encrypter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files-encrypter

Overview

This project utilizes the python cryptography module. The program encrypts / decrypts a file / entire directory with a unique encoded 32-byte key, which makes the files unrecoverable without the private key.

Disclaimer

  1. This project is not intended for any illegal use.
  2. I will not be responsible for any damage / data loss caused by the use of this program.

Installation

cd files-encrypter/
pip3 install -r requirements.txt

Key generation

The algorithm uses a base64-encoded 32-byte key to encrypt & decrypt data, which must be kept secret. So in order to get started, the key must be generated first.

This command generates a unique key in the current directory.

python3 main.py -a keygen

Usage / Flags

IMPORTANT!! Make sure you have generated a key, before start encrypting / decrypting. By default, the program first calls the activate() method, which reads the key and initializes the Crypt class.

Different flags can be passed to perform different operations.

-a (--action)

the -a flag can be either:

  • encode
  • decode
  • keygen

-f (--file) OR -d (--directory) followed by file / directory name

example

-f ./data.txt
-d ./data/

Examples of valid arguments

  1. Encode all the files in ./data/ directory
python3 main.py -a encode -d ./data/
  1. Encode the file named ./data.txt
python3 main.py -a encode -f ./data.txt
  1. Decode the file named ./data.txt
python3 main.py -a decode -d ./data.txt

IMPORTANT Make sure that you're using the same key that was used to encode when decoding, otherwise, the data will NOT be recovered.
Author: Sam Goto

Releases

No releases published

Packages

No packages published

Languages