Skip to content

LockFile is a command-line tool that locks your personal files with AES and RSA encryption algorithms.

License

Notifications You must be signed in to change notification settings

Trisna22/LockFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LockFile

Encrypts/decrypts files on local computer with custom combination of encryption methods. Every file in a folder gets an own key so bruteforcing all files is harder. Make sure to not forget your password or else your data will be gone for good. Your unencrypted files can be shredded if needed.

Installing project

$ git clone https://github.com/Trisna22/LockFile
$ cd LockFile
$ make
$ sudo cp ./build/LockFile /usr/bin
$ LockFile --help

Usage

# For encrypting files/folders
$ LockFile --encrypt folderToEncrypt
# For decrypting files/folders
$ LockFile --decrypt folderToDecrypt
# To get information of any CryptFile
$ LockFile --info cryptFile

Screenshot

plot

CryptFile architecture

<File>
<CryptHeader/>
    <RSA-Encrypted>
        <CryptFile-object>
        <CryptFile-object>
        <CryptFile-object>
        ...
    </RSA-Encrypted>
    <AES-Encrypted>
        <FileData>
        ...
    </AES-Encrypted>
</File>

CryptFile object

The CryptFile object contain information of the encrypted files. Every file has his own key and IV for the AES encryption.
The objects won't be visible without your provided password, the objects itself are encrypted with RSA.

struct CryptFile {
        int fileNameLen;                // The size of the filename.
        bool isFolder;                  // Is folder?
        unsigned short permissions;     // File permissions
        unsigned long sizeFileData;     // File data size.
        unsigned char fileKey[32];      // The key of the AES encryption.
        unsigned char fileIV[16];       // The IV of the AES encryption.
        unsigned char fileHash[16];     // The hash of the (unencrypted) content.
        char *fileName;                 // Filename.
};

Used libraries

OpenSSL [https://www.openssl.org/]
pthreads [https://man7.org/linux/man-pages/man7/pthreads.7.html]

License

MIT

TODO

- [X] Section encryption/decryption.
- [X] Use sendfile() function for better performance
- [X] RSA stream encrypt instead of blocks of data
- [X] File shredder for deleting files
- [X] Improve the AES encryption, write memory-based encryption.
- [~] Create a TUI (Terminal User Interface) animation?
- [X] Threads for better performance
- [X] -r option to auto delete the original files with our shredder
- [X] Threads for decrypting
- [X] Save file permissions in CryptFile. (Read-Write-Execute)
- [ ] Compression algorithm
- [ ] Adding own MIME and file extension
- [ ] -q option to minimize output?

Credits

Me, Myself and I

About

LockFile is a command-line tool that locks your personal files with AES and RSA encryption algorithms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published