|
| 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 and SHA-1 compatibility utilities.
New 0.7.0 overloads:static bool encryptSymmetric(..., unsigned char *after, size_t &outputLength);
static bool decryptSymmetric(..., unsigned char *after, size_t &outputLength);
- New code should use the
outputLength overloads rather than guessing binary lengths. - AES-CBC does not authenticate ciphertext; add authentication or use an AEAD design.
- SHA-1 is retained only for existing protocol compatibility, not passwords, signatures, or new security designs.
The five-argument overloads remain for compatibility. See include/sttnet.h for exact signatures.