mirror of
https://github.com/avinal/Krypto.git
synced 2026-01-10 23:28:36 +05:30
add file decrypt and encryt driver code
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
13
src/Main.cpp
13
src/Main.cpp
@@ -21,9 +21,14 @@ int main(int argc, char const *argv[]) {
|
||||
test.pad_input(buffer, stat.filesize);
|
||||
|
||||
krypto::Encryptor encryptor;
|
||||
// encryptor.blowfish_encrypt(buffer, password, stat.filesize);
|
||||
encryptor.blowfish_decrypt(buffer,password,stat.filesize);
|
||||
test.write_file(filename.substr(8) , buffer, stat.filesize);
|
||||
|
||||
int pos;
|
||||
if ((pos = filename.find("krypto")) != std::string::npos) {
|
||||
encryptor.blowfish_decrypt(buffer, password, stat.filesize);
|
||||
test.write_file(filename.substr(0, pos-1), buffer, stat.filesize);
|
||||
} else {
|
||||
encryptor.blowfish_encrypt(buffer, password, stat.filesize);
|
||||
test.write_file(filename + ".krypto", buffer, stat.filesize);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user