[C++] AES 128 ECB (electronic codebook) 구현
카테고리: C++
문제 상황 C, C++는 다른 언어 (Java, C#, Python)과는 다르게 내부 api가 풍부하지 않다. 그래서 다른 언어에서 쉽게 사용 할 수 있는 aes128을 직접 구현해야 한다. 구글링을 해봐도 Crypto++를 이용하거나, OpenSSL을 이용하여 구현한 자료들 뿐이였다. 소스 코드 본 코드는 aes 128 ECB암호화와 PKCS7 패딩을 구현했다. AES128.cpp /* Serves as the initial round during encryption * AddRoundKey is simply an XOR of a 128-bit block with the 128-bit key. */ void AES128::AddRoundKey(unsigned char * state, un