add driver code for testing

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
2021-03-29 23:50:08 +05:30
parent ad0a56bea9
commit 6b264873f2

View File

@@ -7,11 +7,23 @@
* The driver code
*/
#include "Encryptor.h"
#include "Utils.h"
int main(int argc, char const *argv[]) {
krypto::fileop test;
std::vector<char> buffer;
std::string filename, password;
std::cin >> filename >> password;
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);
return 0;
}