Aug 18, 2024 04:34 PM
(This post was last modified: Aug 18, 2024 06:17 PM by SovietBastard.)
First of all, im quite new here, so dont kill me if i violate some kind of rule im not aware of, any comment or opinion or even critique is appreciated and keep in mind this is just something i did on the fly to share with people here as i saw someone in the other threads complaining that nobody is posting anything, i decided to make a little contribution, if you like it, let me know, if you dont like it, let me know as well, im trying to make a point here, showing how to do c++ full disk encryption using 2 other modules of mine, one for encryption and decryption, the other for filesystem operations(I/O...), encryption is performed using CGM(galois-counter mode) mode of operation, which is an authenticated encryption/decryption cipher,it combines the counter(CTR) mode with a galois field multiplication for authentication and relies on cipher tags which will be used to authenticated the block cipher. GCM mode use PBKDF2 HMAC(hash-based message authentication code), this is used to derive the final key, a salt is added to the cipher just to make happy everyone, and yes.... the IV is unique for every counter block generated, this is the standard for serious security, well i don't know if is standard everywhere, but definitely if i have GCM mode available along with CBC and CTR modes, i will always select GCM, it has this balance which is perfect between efficiency, security and integrity, definitely good choice if you want performance and speed of execution, and.... for the algorithm, used AES, standard shit, the algorithm can be changed dynamically at runtime and can be changed with (mars, twofish or rc6).
was thinking about CBC mode, but it does not support authentication, but ... it supports more algorithms than GCM, also GOST mode which is pretty good. and right now im thinking about adding all 6 modes of operation(cbc, gcm, aex, cfb, ofb and ctr), im still thinking about it, it is possible that i will end up using GCM mode with AES anyway so fuck that... im writing this on a linux machine x86-64 bit system, but there shouldn't be any compatibility issues if you take the source code and re-compile it on your system, better if use gcc or clang compiler because i usually make use of inline compiler optimization attributes to optimize where possible... Librar.y crypto++ must be installed on your system or compilation will fail, to install it on linux type "apt install libcrypto++-dev" or something like that, and it will install the library which the cryptography module heavily relies on for its compatibility, availability and efficiency. The encrypted data can be decrypted only if the key match, to decrypt just rerun the program and execute "decrypt" on the target with the correct key and it will decrypt the content if the key is good. Side project folks.
Last thing is... due to some issues with large files when reading their content, module FSController uses memory to store buffers and stream content, this increased the speed of execution a lot.
Run:
Common syntax:
Flags:
the following flags can be used for execute&exit or persistent execution mode:
--help
--recursive
--verbose
--backup
--backup-path <PATH>
--secret <SECRET>
--target <TARGET_PATH>
--direct
--encrypt
--decrypt
--use-atomic
--interface
--recursive: encrypt/decrypt recursively
--verbose: print output
--backup: create backup before
--backup-path: set backup path, will create if not found
--secret: set secret key
--target: set target path
--direct: direct execution, will no stop execution for confirmations
--encrypt: encryption of target
--decrypt: decryption of target
--use-atomic: sets verbose to false and --direct to true
--interface uses a cool interface for command push
Use --interface for persistent execution, or --direct for single execution.
below attached some screenshots, showing the command&control console interface and other useful information that might interest you.
LAUNCH
![[Image: remove_image_metadata_9a87000841f99aecc7...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_9a87000841f99aecc78ee21c90c5162e_66c278b6a4795.png?raw=true)
SHOW COMMANDS, OPTIONS...
![[Image: remove_image_metadata_178e06d8f3e02dd5d3...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_178e06d8f3e02dd5d30b1aaf62a0c2d7_66c278b6a839a.png?raw=true)
NON ENCRYPTED DIRECTORY(RECURSIVE)
![[Image: remove_image_metadata_96073bd4c99fe1c903...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_96073bd4c99fe1c903808ea9d342f615_66c278b6af662.png?raw=true)
ENCRYPTED
![[Image: remove_image_metadata_429c94f4a8a1b6f50e...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_429c94f4a8a1b6f50e75611cbececaec_66c278b6ac3a0.png?raw=true)
all files are encrypted, but the difference is only observable on the image file on my system
Source code and binary: https://github.com/Somorpher/Diskrypt
was thinking about CBC mode, but it does not support authentication, but ... it supports more algorithms than GCM, also GOST mode which is pretty good. and right now im thinking about adding all 6 modes of operation(cbc, gcm, aex, cfb, ofb and ctr), im still thinking about it, it is possible that i will end up using GCM mode with AES anyway so fuck that... im writing this on a linux machine x86-64 bit system, but there shouldn't be any compatibility issues if you take the source code and re-compile it on your system, better if use gcc or clang compiler because i usually make use of inline compiler optimization attributes to optimize where possible... Librar.y crypto++ must be installed on your system or compilation will fail, to install it on linux type "apt install libcrypto++-dev" or something like that, and it will install the library which the cryptography module heavily relies on for its compatibility, availability and efficiency. The encrypted data can be decrypted only if the key match, to decrypt just rerun the program and execute "decrypt" on the target with the correct key and it will decrypt the content if the key is good. Side project folks.
Last thing is... due to some issues with large files when reading their content, module FSController uses memory to store buffers and stream content, this increased the speed of execution a lot.
Run:
Code
$ ./diskcrypt [additional-flags]Common syntax:
Code
$ ./diskcrypt --target target_path --secret 123secret --encrypt
$ ./diskcrypt --target target_path --secret 123secret --decrypt
OR
$ ./diskcrypt --interface // easier for someone out there...Flags:
the following flags can be used for execute&exit or persistent execution mode:
--help
--recursive
--verbose
--backup
--backup-path <PATH>
--secret <SECRET>
--target <TARGET_PATH>
--direct
--encrypt
--decrypt
--use-atomic
--interface
--recursive: encrypt/decrypt recursively
--verbose: print output
--backup: create backup before
--backup-path: set backup path, will create if not found
--secret: set secret key
--target: set target path
--direct: direct execution, will no stop execution for confirmations
--encrypt: encryption of target
--decrypt: decryption of target
--use-atomic: sets verbose to false and --direct to true
--interface uses a cool interface for command push
Use --interface for persistent execution, or --direct for single execution.
below attached some screenshots, showing the command&control console interface and other useful information that might interest you.
LAUNCH
![[Image: remove_image_metadata_9a87000841f99aecc7...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_9a87000841f99aecc78ee21c90c5162e_66c278b6a4795.png?raw=true)
SHOW COMMANDS, OPTIONS...
![[Image: remove_image_metadata_178e06d8f3e02dd5d3...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_178e06d8f3e02dd5d30b1aaf62a0c2d7_66c278b6a839a.png?raw=true)
NON ENCRYPTED DIRECTORY(RECURSIVE)
![[Image: remove_image_metadata_96073bd4c99fe1c903...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_96073bd4c99fe1c903808ea9d342f615_66c278b6af662.png?raw=true)
ENCRYPTED
![[Image: remove_image_metadata_429c94f4a8a1b6f50e...g?raw=true]](https://github.com/Somorpher/Diskrypt/blob/main/images/remove_image_metadata_429c94f4a8a1b6f50e75611cbececaec_66c278b6ac3a0.png?raw=true)
all files are encrypted, but the difference is only observable on the image file on my system
Source code and binary: https://github.com/Somorpher/Diskrypt
