Skip to content

JOELKUNDU/Zenc-command-line-file-encrypter-decryptor

Repository files navigation

Zenc - command line file encrypter / decryptor

A command line cross platform File/Folder encryptor written in c++ and based on Crypto++ library
Visit the site

Checkout CONTRIBUTING.md to see the contributing guidelines.

How to use?

Windows

-have g++ and libcrypto++(crypto++) preinstalled and configured
-Run Make.bat
else (if you are having issues with g++ and libcrypto++)
-run make_path.bat, this will create a directory c:\Zenc
-Copy exe from release folder to c:\Zenc and use it.

Linux

Clone the repository and open a terminal in the root and use:
   sudo apt-get install g++
   sudo apt-get install libcryptopp++
   g++ src/Zenc.cpp -std=c++17 -lstdc++fs -lcrypto++ -o /usr/bin/Zenc

NOTE: optional - upx the executable (-9 --lzma) (slight boost in performance)

Encryption modes supported:

1. AES-GCM with 2k tables
2. AES-GCM with 64k tables
3. AES-EAX
4. AES-CBC
5. AES-ECB
6. AES-CTR
7. AES-CFB
8. AES-OFB
9. ChaCha20 (stream cipher)
10. XChaCha20 (stream cipher)

How to use

Zenc [-h or -H/-e/-ed/-d/-dd] [FILE PATH] -m [mode] [-p/-np] [Password in case of using -p] [-t -g]
-h or -H   Help Menu
-e    Encrypt a file
-ed   Encrypt a directory
-d    Decrypt a file
-dd   Decrypt a directory
-m    Mode of Encryption / Decryption (gcm2k,gcm64k,eax,cbc,ecb,ctr,cfb,ofb)
-p    Password provided by the user (no limit in length or characters)
-np   Either a .zkey file is created or if -g is mentioned then a password is created
-t    Will encrypt/decrypt the titles and the extention
-g    Will generate a password of the length specified by the user

NOTE:

1. To delete files run it on an elevated terminal else Permission Denied error will occur.
2. Time taken to do the operation will be displayed in microseconds in the end.

EXAMPLE COMMANDS:

   1. To open the help book:

          Zenc -h
          Zenc -H
          Zenc

   2. To Encrypt a file: 

          Zenc -e C:\test\test.txt -m gcm2k -p Password123 -t (encrypt with a passwprd)     
          Zenc -e C:\test\test.txt -m gcm2k -p C:\test\test.zkey -t (encrypt with a keyfile)   
          Zenc -e C:\test\test.txt -m gcm2k -np -t (generate a keyfile)
          Zenc -e C:\test\test.txt -m gcm2k -np -t -g (generate a password)

   3. To Encrypt a Directory : 

          Zenc -ed C:\test\ -m gcm2k -p Password123 - t (encrypt with a passwprd)
          Zenc -ed C:\test\ -m gcm2k -p C:\test\test.zkey -t (encrypt with a keyfile)
          Zenc -ed C:\test\ -m gcm2k -np -t (generate a keyfile)
          Zenc -ed C:\test\ -m gcm2k -np -t -g (generate a password)

   4. To Decrypt a file: 

          Zenc -d C:\test\test.txt -m gcm2k -p Password123 -t (decrypt with a passwprd)
          Zenc -d C:\test\test.txt -m gcm2k -p C:\test\test.zkey -t (decrypt with a keyfile)

   5. To Decrypt a Directory : 

          Zenc -dd C:\test\ -m gcm2k -p Password123 -t (decrypt with a passwprd)
          Zenc -dd C:\test\ -m gcm2k -p C:\test\test.zkey -t (decrypt with a keyfile)

NOTE: change Zenc according to your environment.