-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcrypto.h
25 lines (19 loc) · 764 Bytes
/
crypto.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once
#include <string>
#include <stdexcept>
class BadPaddingException : public std::runtime_error {
public:
BadPaddingException() : std::runtime_error("Bad padding") {
}
};
class Code42Cipher {
public:
virtual std::string decrypt(const std::string & cipherText, const std::string & key) const = 0;
virtual std::string encrypt(const std::string & plainText, const std::string & key) const = 0;
};
class Code42AES256RandomIV : public Code42Cipher {
public:
std::string decrypt(const std::string & cipherText, const std::string & key) const override;
std::string encrypt(const std::string & plainText, const std::string & key) const override;
};
std::string generateSmallBusinessKeyV2(const std::string &passphrase, const std::string &salt);