mirror of
https://github.com/avinal/Krypto.git
synced 2026-01-10 07:08:35 +05:30
add driver code for testing
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
12
src/Main.cpp
12
src/Main.cpp
@@ -7,11 +7,23 @@
|
|||||||
* The driver code
|
* The driver code
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "Encryptor.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
|
||||||
int main(int argc, char const *argv[]) {
|
int main(int argc, char const *argv[]) {
|
||||||
krypto::fileop test;
|
krypto::fileop test;
|
||||||
std::vector<char> buffer;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user