AES加密算法的C++實(shí)現(xiàn)過(guò)程

AES加密算法的C++實(shí)現(xiàn)過(guò)程

ID:27773616

大?。?1.18 KB

頁(yè)數(shù):12頁(yè)

時(shí)間:2018-12-06

AES加密算法的C++實(shí)現(xiàn)過(guò)程_第1頁(yè)
AES加密算法的C++實(shí)現(xiàn)過(guò)程_第2頁(yè)
AES加密算法的C++實(shí)現(xiàn)過(guò)程_第3頁(yè)
AES加密算法的C++實(shí)現(xiàn)過(guò)程_第4頁(yè)
AES加密算法的C++實(shí)現(xiàn)過(guò)程_第5頁(yè)
資源描述:

《AES加密算法的C++實(shí)現(xiàn)過(guò)程》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)。

1、//AES.H#ifndef_AES_H_#define_AES_H_#include"stdafx.h"#defineAES_KEY_ROW_NUMBER4#defineAES_KEY_COLUMN_NUMBER4#defineAES_ROUND_COUNT10classAES:publicEncryption{public:AES(void);AES(BYTE*key);virtual~AES(void);voidEncrypt(BYTE*,BYTE*,size_t);voidDecrypt(BYTE*,BYTE*,size_t);private:BYTEswa

2、pbox[11][4][4];BYTE*Cipher(BYTE*input);BYTE*InvCipher(BYTE*input);BYTE*Cipher(void*input,size_tlength);BYTE*InvCipher(void*input,size_tlength);voidKeyExpansion(BYTE*key,BYTEw[][4][AES_KEY_COLUMN_NUMBER]);BYTEFFmul(BYTEa,BYTEb);voidSubBytes(BYTEstate[][AES_KEY_COLUMN_NUMBER]);voidShiftR

3、ows(BYTEstate[][AES_KEY_COLUMN_NUMBER]);voidMixColumns(BYTEstate[][AES_KEY_COLUMN_NUMBER]);voidAddRoundKey(BYTEstate[][AES_KEY_COLUMN_NUMBER],BYTEk[][AES_KEY_COLUMN_NUMBER]);voidInvSubBytes(BYTEstate[][AES_KEY_COLUMN_NUMBER]);voidInvShiftRows(BYTEstate[][AES_KEY_COLUMN_NUMBER]);voidInv

4、MixColumns(BYTEstate[][AES_KEY_COLUMN_NUMBER]);};#endif//_AES_H_//Encryption.h#ifndef_ENCRYPTION_H_#define_ENCRYPTION_H_#include"stdafx.h"classEncryption{public:virtualvoidEncrypt(BYTE*,BYTE*,size_t)=0;virtualvoidDecrypt(BYTE*,BYTE*,size_t)=0;};#endif//EncryptionFactory.h#ifndef_ENCRYP

5、TION_FACTORY_H_#define_ENCRYPTION_FACTORY_H_#include"Encryption.h"#include"stdafx.h"classEncryptionFactory{public:EncryptionFactory(void);virtual~EncryptionFactory(void);staticEncryption*getEncryption(intencryptionType,BYTE*key);private:staticEncryption*encry;};#endif//AES.cpp#include"

6、stdafx.h"#include"AES.h"#include#include//permuteboxstaticunsignedcharpermutebox[]={/*0123456789abcdef*/0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,/*0*/0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0x

7、c0,/*1*/0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15,/*2*/0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75,/*3*/0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84,/*4*/0x53,0xd1,0x00,0xed,0

當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動(dòng)畫的文件,查看預(yù)覽時(shí)可能會(huì)顯示錯(cuò)亂或異常,文件下載后無(wú)此問題,請(qǐng)放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫(kù)負(fù)責(zé)整理代發(fā)布。如果您對(duì)本文檔版權(quán)有爭(zhēng)議請(qǐng)及時(shí)聯(lián)系客服。
3. 下載前請(qǐng)仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時(shí)可能由于網(wǎng)絡(luò)波動(dòng)等原因無(wú)法下載或下載錯(cuò)誤,付費(fèi)完成后未能成功下載的用戶請(qǐng)聯(lián)系客服處理。