AES 128 block cipher problem running
-
Hi, I'm still a beginner in coding, I need block cipher source code for my research paper where I need to get the run time for mode of operation, I already find a lot of source code but none of it seems working, example the crypto++ . I don't even know how to set it up. if anyone could help me at least on how to run the crypto++ . and fyi im using a quad core processor laptop, windows 10 and visual studio 2015. :(( :(( :((
-
Hi, I'm still a beginner in coding, I need block cipher source code for my research paper where I need to get the run time for mode of operation, I already find a lot of source code but none of it seems working, example the crypto++ . I don't even know how to set it up. if anyone could help me at least on how to run the crypto++ . and fyi im using a quad core processor laptop, windows 10 and visual studio 2015. :(( :(( :((
-
You could use
Microsoft Crypto API
. They provide documentation and examples: Using Cryptography (Windows)[^].Hi here you go: The header file, aes.h:
#ifndef AES_H
#define AES_H#include #include using namespace std;
class aes
{
public:
aes(vector& , vector&, unsigned int);
~aes();
vector encrypt();
vector dencrypt();
private:
bool debugg = false;
vector str_key;
vector > KEY;
vector > KEY_SCHEDULE;
vector str_io;
vector > INPUT, OUTPUT;
unsigned int KEY_LENGHT;
unsigned int ROUNDS;
unsigned int GROUP_SIZE;
unsigned int BLOCK_SIZE = 16;//variabile static const unsigned char sbox\[256\]; static const unsigned char isbox\[256\]; static const unsigned char srcon\[256\]; static const unsigned char by\_2\[256\]; static const unsigned char by\_3\[256\]; static const unsigned char by\_9\[256\]; static const unsigned char by\_11\[256\]; static const unsigned char by\_13\[256\]; static const unsigned char by\_14\[256\]; //functii void getKeyFromString(vector&); void gen\_key\_schedule(vector >&); vector x\_xor(vector, vector); vector g(vector&, unsigned int); void subytes(vector >&); void isubytes(vector >&); vector subytesWord(vector&); void debug(vector >&); void dgetInputFromString(vector&); vector > beginEcryptForBlock(vector >&);//beginDEcryptForBlock vector > beginDEcryptForBlock(vector >&); void addRound(vector >&, vector >&); void getWFrmKeySched(unsigned int, vector >&); void shiftRows(vector >&, vector&, vector&, vector&); void ishiftRows(vector >&, vector& , vector& , vector& ); void mixCol(vector >&); void imixCol(vector >&); unsigned int getNextByte(unsigned int, unsigned int); void populateVector4x4(vector >&);
};
#endif // AES_H
The cpp file , aes.cpp:
#include "aes.h"
#include
#include
#includeus