Renamed cipher class

This commit is contained in:
Leonetienne
2021-12-06 01:38:43 +01:00
parent 65f80b5d2d
commit fbead384e2
8 changed files with 27 additions and 27 deletions

38
GhettoCipher.h Normal file
View File

@@ -0,0 +1,38 @@
#pragma once
#include "Feistel.h"
#include "Flexblock.h"
/** Class to apply a block cipher to messages of arbitrary length in a distributed manner
*/
class GhettoCipher
{
public:
explicit GhettoCipher(const Block& key);
explicit GhettoCipher(const std::string& password);
GhettoCipher(const GhettoCipher& other) = delete;
GhettoCipher(GhettoCipher&& other) noexcept = delete;
~GhettoCipher();
//! Will set the key
void SetKey(const Block& key);
//! Will set the key from a password
void SetPassword(const std::string& password);
//! Will encipher a flexblock of data
Flexblock Encipher(const Flexblock& data, bool printProgress = false) const;
//! Will decipher a flexblock of data
Flexblock Decipher(const Flexblock& data, bool printProgress = false) const;
private:
Block key;
//! Will zero the memory used by the key
void ZeroKeyMemory();
// Initial value for cipher block chaining
static const Block emptyBlock;
};