Exemple #1
0
byte * AES128::encrypt(byte *message) {
	int i;

	memcpy((void*)state, (const void*)message,16);
	
	initKey();
	addRoundKey();

	for(i = 0; i < 9; i++) {
 		subBytes();
		shiftRows();
		mixColumns();
		computeKey(pgm_read_byte(rcon + i));
		addRoundKey();
	}

	subBytes();
	shiftRows();
	computeKey(pgm_read_byte(rcon + i));
	addRoundKey();

	memcpy((void*)message,(const void*)state, 16);	
	return message;
}
Exemple #2
0
scypherBase::scypherBase(byteBlock key) {
	initKey(key.getStr());
}
Exemple #3
0
scypherBase::scypherBase(std::string key) {
	initKey(key);
}
Exemple #4
0
scypherBase::scypherBase() {
	std::string key;
	for (uint64_t i=0; i<16; i++) { key += '\x00'; }
	initKey(key);
}
Exemple #5
0
void scypherBase::setKey(std::string key) {
	initKey(key);
}
Exemple #6
0
void make_SubKey(char key[8])
{
    unsigned short key64[64];
    byteTo64Int(key,key64);
    initKey(key64,keyset);
}