中间件底层,websocket

Crypto.h 560B

123456789101112131415161718192021
  1. #pragma once
  2. #include <string>
  3. class Crypto
  4. {
  5. public:
  6. // aes ebc 加密(输出 base64)
  7. static std::string aes_encrypt_ecb_base64(std::string data, unsigned char* key, int keylen);
  8. // aes ebc 加密(输出 hex)
  9. static std::string aes_encrypt_ecb_hex(std::string data, unsigned char* key, int keylen);
  10. // aes ebc 解密(输出 hex)
  11. static std::string aes_decrypt_ecb_hex(std::string hex_data, unsigned char* key, int keylen);
  12. // aes ebc 解密(输出 base64)
  13. static std::string aes_decrypt_ecb_base64(std::string base64_data, unsigned char* key, int keylen);
  14. };