我应该两次超载下面的课程。曾经我应该使用 AES (Rijndael) 和 Twofish 来实现它。但是,我似乎找不到一个只允许加密单个块的简单实现。我发现的实现包括 CBC 和 Padding。有什么提示吗?
#ifndef CRYPTER_H
#define CRYPTER_H
#include <valarray>
class Crypter {
public:
Crypter();
virtual ~Crypter();
//Encrypts a single block of 16 byte.
virtual std::valarray<unsigned char> encrypt(std::valarray<unsigned char> plaintext,
std::valarray<unsigned char> passphrase) = 0;
//Decrypts a single block of 16 byte.
virtual std::valarray<unsigned char> decrypt(std::valarray<unsigned char> cyphertext,
std::valarray<unsigned char> passphrase) = 0;
};
#endif /* CRYPTER_H */