mirror of
https://github.com/vgough/encfs.git
synced 2025-08-13 23:48:59 +02:00
encapsulate old cipher support layer
git-svn-id: http://encfs.googlecode.com/svn/trunk@95 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
@ -26,26 +26,32 @@
|
||||
#include "base/Registry.h"
|
||||
#include "base/shared_ptr.h"
|
||||
#include "base/types.h"
|
||||
#include "cipher/CipherKey.h"
|
||||
|
||||
namespace encfs {
|
||||
|
||||
static const char NAME_AES_CFB[] = "AES/CFB";
|
||||
static const char NAME_BLOWFISH_CFB[] = "Blowfish/CFB";
|
||||
|
||||
class StreamCipher
|
||||
{
|
||||
public:
|
||||
static Registry<StreamCipher>& GetRegistry();
|
||||
DECLARE_REGISTERABLE_TYPE(StreamCipher);
|
||||
|
||||
struct Properties {
|
||||
Range keySize;
|
||||
std::string cipher;
|
||||
std::string mode;
|
||||
std::string library;
|
||||
std::string toString() const {
|
||||
return cipher + "/" + mode;
|
||||
}
|
||||
};
|
||||
|
||||
StreamCipher();
|
||||
virtual ~StreamCipher();
|
||||
|
||||
virtual bool setKey(const byte *key, int keyLength) =0;
|
||||
virtual bool randomKey(int keyLength) =0;
|
||||
virtual bool setKey(const CipherKey& key) =0;
|
||||
|
||||
virtual bool encrypt(const byte *iv, const byte *in,
|
||||
byte *out, int numBytes) =0;
|
||||
|
Reference in New Issue
Block a user