Skip to content

0x7f9/datalok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Crypto Crate Base64 Crate

Simple, fast and lightweight CLI data locking tool built in rust.

How The Process Works

Encryption process:

  1. Encrypt the file contents using Chacha20poly1305 and save them to a file with an extension 'lok'.
  2. Combine the nonce, salt used in the encryption, and the file extension.
  3. Encrypt the combined values using stored binary data to secure them.
  4. Encode everything to base64 using a custom engine, then convert to binary to increase the file size before compressing.
  5. Delete the original file from the system.

Decryption process:

  1. Decompress and then decode the data.
  2. Extract the encrypted combined values, and decrypt them.
  3. Extract the encrypted file contents.
  4. Using the decrypted values to decrypt the extracted file contents and restore the file to its original state.

Password File Examples

  • A random stream of characters inside a file.
  • The contents of a file already on your computer.
  • Generate a unique cryptographic key to use inside a file.
  • Append numbers or letters to an existing file to create a password file. With the ability to remove the appended characters after encryption, and only add them back before decryption.

How to Use

# Build from source
# Build location: datalok/target/release/datalok
cd "download folder"/datalok
cargo build --release

# Example usage:
# datalok <file/folder> [-s] <-e | -d> [-r] [-p]

#  Flags:
#    -e Encryption 
#    -d Decryption 
#    -s Start a session
#    -r Recursively processes files in a directory
#    -p Prompted to type in a password

# Encrypt a file:
  datalok <file> -e
# Encrypt a file by entering a password:
  datalok <file> -e -p
# Decrypt a folder recursively:
  datalok <folder> -d -r
# Start a session:
  datalok -s
# Start a session by entering a password:
  datalok -s -p

Session features include:

  • Stores the password or password file for the duration of the session.
  • Capable of encrypting or decrypting files from any location on the system.
  • Uses the system file explorer when selecting files or folders to process.
# Example session usage:
#  <e | d> [-r]

#  Commands:
#    e | encrypt - Encryption
#    d | decrypt - Decryption
#    h | help - Shows all commands
#    exit - Exits the session
  
#  Flags:
#    -r Recursively processes files in a directory

# Encrypt a folder recursively:
  e -r
# Decrypt a folder recursively:
  decrypt -r