From 9fe7c09471520e93031016ab6b936fc7068c1f36 Mon Sep 17 00:00:00 2001 From: avinal <185067@nith.ac.in> Date: Tue, 16 Feb 2021 17:48:29 +0530 Subject: [PATCH] blowfish header file added --- include/blowfish/blowfish.hpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/blowfish/blowfish.hpp diff --git a/include/blowfish/blowfish.hpp b/include/blowfish/blowfish.hpp new file mode 100644 index 0000000..e5730b3 --- /dev/null +++ b/include/blowfish/blowfish.hpp @@ -0,0 +1,33 @@ +/** + * @file blowfish.hpp + * @author Avinal Kumar + * @since February 15, 2021 + * + * Blowfish Algorithm Header File + */ + +#define MAXKEYBYTES 56 // 448 bits max + +#define DWORD unsigned long +#define WORD unsigned int +#define BYTE unsigned char + +#if !defined(BLOWFISH_HPP) +#define BLOWFISH_HPP + +#include +#include + +class blowfish { +private: + std::array PArray; + std::array, 4> Sboxes; + DWORD F(DWORD x); + +public: + blowfish(BYTE *key, WORD keylength); + void encrypt(DWORD *xl, DWORD *xr); + void decrypt(DWORD *xl, DWORD *xr); +}; + +#endif // BLOWFISH_HPP