summaryrefslogtreecommitdiffstats
path: root/Cryptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'Cryptor.h')
-rw-r--r--Cryptor.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/Cryptor.h b/Cryptor.h
index 8ba1c16..1fcac36 100644
--- a/Cryptor.h
+++ b/Cryptor.h
@@ -4,6 +4,7 @@
#include <iostream>
#include <string>
#include <fstream>
+#include <vector>
#ifdef WIN32
#include <windows.h>
@@ -12,17 +13,16 @@
#include <unistd.h>
#endif // WIN32
-#include "cryptopp562/osrng.h"
-#include "cryptopp562/cryptlib.h"
-#include "cryptopp562/hex.h"
-#include "cryptopp562/filters.h"
-#include "cryptopp562/aes.h"
-#include "cryptopp562/ccm.h"
+#include "mbedtls/cipher.h"
+#include "mbedtls/ctr_drbg.h"
+#include "mbedtls/entropy.h"
#include "Socket.h"
#define DEF_PASSWD_LENGTH 50
+#define AES_BLOCK_LENGTH 16
+
#define KEYCHAIN_FILE ".compasskeychain"
#define PASSWORD_PROMPT "ComPASS Password: "
#define PASSWORD_CONF "Confirm Password: "
@@ -49,9 +49,10 @@ public:
private:
static bool haveKey;
- static unsigned char key[CryptoPP::AES::DEFAULT_KEYLENGTH];
+ static unsigned char key[AES_BLOCK_LENGTH];
static void sha256(std::string str);
+ static void generateRandom(void *output, size_t size);
static std::string readPassword(bool confirm);
static std::string readPassword();
static void assembleKey(bool confirm);