我不想每次更新都比较版本,所以分享出来: https://github.com/halx99/cocos2d-x-pc-port
在cocos2d-x中使用AES: https://github.com/halx99/cocos2d-x-pc-port/tree/master/crypto-support
用法:
// 复用内存方式:
std::string msg1 = “hello world, ok!”;
crypto::aes::overlapped::encrypt(msg1);
crypto::aes::overlapped::decrypt(msg2);
// 普通方式
std::string ciphertext = crypto::aes::encrypt(msg1);
std::string plaintext = crypto::aes::decrypt(ciphertext);