Coder Social home page Coder Social logo

crypto-py's Introduction

Crypto-Py

Crypto-Py is a command line tool for encrypting and decrypting files and folders using synchronous keys. It is written in Python and can be converted to a .exe file using Pyinstaller.

Installation

To install Pyinstaller, run the following command in your terminal:

pip install pyinstaller
To convert the Python file to an executable, run the following command:
pyinstaller --onefile crypto.py

Usage

To use Crypto-Py, run the crypto.exe file followed by the appropriate command line options.

Options

--help, -h: show the help message and exit

--encrypt, -e: Encrypt the file or folder

--decrypt, -d: Decrypt the file or folder

--newkey, -n: Generate a new key for encryption or decryption

--nooutputkey, -nok: Do not output the keyfile (DANGER ZONE)

--key, -k KEY_STRING: Key string to use for encryption or decryption

--keyfile, -kf KEY_FILE: Key file to use for encryption or decryption

--targets, -t FILE_OR_FOLDER [FILE_OR_FOLDER ...]: One or more files or directories to encrypt or decrypt (recurses through all sub-directories)

--include, -in PATERN [PATERN ...]: Include matching files when target is a directory (ex: -in *.txt *.jpg)

--exclude, -ex PATERN [PATERN ...]: Exclude matching files when target is a directory (ex: -ex *.log *.png)

--backup, -b BACKUP_FILE: Specify a backup file to store path and encryption/decryption key

--list, -l: Only list but do not modify any files

Examples

Encrypt a file with a new key file:

# By default, keyfile will be save in the default user directory
crypto.exe --newkey --encrypt --targets /user/data/myfile.txt

Use existing key file:

crypto.exe --encrypt --keyfile keyfile.key --targets /user/data/myfile.txt

Decrypt a file or folder:

# Decrypt myfile.txt
crypto.exe --newkey --keyfile keyfile.key --decrypt --targets /user/data/myfile.txt
# Decrypt directory folder and all files in subfolders
crypto.exe --newkey --keyfile keyfile.key --decrypt --targets /user/data/directory

Include only certain file types when encrypting a directory (include only .txt files):

crypto.exe --encrypt --keyfile keyfile.key --targets /user/data/directory --include *.txt

Exclude certain file types when encrypting a directory (exclude all .log files):

crypto.exe --encrypt --keyfile keyfile.key --targets /user/data/directory --exclude *.log

Backup To backup the paths and encryption/decryption keys for your files, use the --backup option followed by the name of the backup file. For example:

crypto.exe --encrypt --keyfile /user/bkp/keyfile.key --targets /user/data/myfile.txt --backup /user/bkp/backup.txt

This will create a backup file called backup.txt that can be used to restore the encryption/decryption keys for your files.

Disclaimer

Please use Crypto-Py at your own risk. It is your responsibility to ensure that your files are properly encrypted and that you have backups of your encryption/decryption keys.

crypto-py's People

Contributors

pandidoux avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.