aboutsummaryrefslogtreecommitdiff
path: root/aes.h
blob: 9274d21ed426d2877ec3ddb65f84b85db765c4eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include <string>

namespace AES{

	enum Algorithm{
		AES_128_CBC,
		AES_192_CBC,
		AES_256_CBC,
	};

	std::string encrypt(const std::string &data,const std::string &key,Algorithm algo);

	//throws invalid_argument for an invalid ciphertext (length not a multiple of block size, or padding malformed) or an invalid key (invalid length)
	std::string decrypt(const std::string &data,const std::string &key,Algorithm algo);

}