|
| static bool | encryptSymmetric (const unsigned char *before, const size_t &length, const unsigned char *passwd, const unsigned char *iv, unsigned char *after) |
| | AES-256-CBC模式对称加密函数
|
| |
| static bool | decryptSymmetric (const unsigned char *before, const size_t &length, const unsigned char *passwd, const unsigned char *iv, unsigned char *after) |
| | AES-256-CBC模式对称解密函数
|
| |
| static std::string & | sha1 (const std::string &ori_str, std::string &result) |
| | 计算输入字符串的 SHA-1 哈希值(原始二进制形式)。
|
| |
| static std::string & | sha11 (const std::string &ori_str, std::string &result) |
| | 计算输入字符串的 SHA-1 哈希值,并以十六进制字符串形式返回。
|
| |
AES-256-CBC 与 SHA-1 兼容工具。
0.7.0 新重载:static bool encryptSymmetric(..., unsigned char *after, size_t &outputLength);
static bool decryptSymmetric(..., unsigned char *after, size_t &outputLength);
- 新代码应使用带
outputLength 的重载,不能猜测二进制输出长度。 - AES-CBC 不提供完整性认证;生产协议应额外认证密文或采用 AEAD。
- SHA-1 仅用于既有协议兼容,不用于密码、签名或新的安全设计。
旧的五参数重载为兼容保留;完整签名以 include/sttnet.h 为准。