2021-02-18 22:09:51 +05:30
|
|
|
/**
|
|
|
|
|
* /mnt/z/my_git/RCRS-CSD-327/src/Main.cpp
|
|
|
|
|
* @file Main.cpp
|
|
|
|
|
* @author Avinal Kumar
|
|
|
|
|
* @since February 18, 2021
|
|
|
|
|
*
|
|
|
|
|
* The driver code
|
|
|
|
|
*/
|
|
|
|
|
|
2021-03-29 23:50:08 +05:30
|
|
|
#include "Encryptor.h"
|
2021-03-25 23:08:35 +05:30
|
|
|
#include "Utils.h"
|
|
|
|
|
|
2021-02-18 22:09:51 +05:30
|
|
|
int main(int argc, char const *argv[]) {
|
2021-03-25 23:08:35 +05:30
|
|
|
krypto::fileop test;
|
|
|
|
|
std::vector<char> buffer;
|
2021-03-29 23:50:08 +05:30
|
|
|
std::string filename, password;
|
|
|
|
|
std::cin >> filename >> password;
|
2021-03-05 01:49:06 +05:30
|
|
|
|
2021-03-29 23:50:08 +05:30
|
|
|
krypto::filestat stat(filename);
|
|
|
|
|
test.read_file(filename, buffer, stat);
|
|
|
|
|
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);
|
|
|
|
|
|
2021-02-18 22:09:51 +05:30
|
|
|
return 0;
|
|
|
|
|
}
|