aboutsummaryrefslogtreecommitdiff
path: root/aes.h
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-10-07 20:33:18 +0200
committertomsmeding <tom.smeding@gmail.com>2016-10-07 20:33:18 +0200
commit241518f369efce64046be36a15fcb722b00e9477 (patch)
tree1aaa6e56e027df35503c497b3c1ef5fa6e8e7916 /aes.h
parent8ee3380a6b116778ccd1a895802465884f58a9b9 (diff)
Working AES encrypt and decrypt!
Diffstat (limited to 'aes.h')
-rw-r--r--aes.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/aes.h b/aes.h
index 012c9ed..b2064f2 100644
--- a/aes.h
+++ b/aes.h
@@ -5,12 +5,16 @@
namespace AES{
enum Algorithm{
- AES_128,
- AES_192,
- AES_256,
+ AES_128_CBC,
+ AES_192_CBC,
+ AES_256_CBC,
};
std::string encrypt(const std::string &key,const std::string &data,Algorithm algo);
+
+ //throws invalid_argument for an invalid ciphertext (length not a multiple of block size, or padding malformed)
std::string decrypt(const std::string &key,const std::string &data,Algorithm algo);
+ void test();
+
}