负责加密,解密和哈希 更多...
#include <sttnet.h>
静态 Public 成员函数 | |
| 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 哈希值,并以十六进制字符串形式返回。 更多... | |
负责加密,解密和哈希
|
static |
AES-256-CBC模式对称解密函数
| before | 密文的数据容器 |
| length | 密文的数据长度 |
| passwd | 密钥 |
| iv | iv向量 |
| after | 解密后的数据容器 |
|
static |
AES-256-CBC模式对称加密函数
| before | 加密前的数据容器 |
| length | 数据前的数据长度 |
| passwd | 密钥 |
| iv | iv向量 |
| after | 密文的数据容器 |
|
static |
计算输入字符串的 SHA-1 哈希值(原始二进制形式)。
使用 OpenSSL 的 SHA1 函数对输入字符串进行哈希处理,结果以 20 字节的原始二进制形式存储在 result 中。 注意:result 可能包含不可打印字符,不适合直接输出或写入文本。
| ori_str | 输入的原始字符串。 |
| result | 用于存放输出的 SHA-1 哈希值(二进制形式),长度为 20 字节。 |
|
static |
计算输入字符串的 SHA-1 哈希值,并以十六进制字符串形式返回。
使用 OpenSSL 的 SHA1 函数对输入字符串进行哈希处理,结果以 40 个字符的十六进制格式表示存储在 result 中。 每个字节转换为两个十六进制字符,可直接用于打印、日志记录、存储等可读场景。
| ori_str | 输入的原始字符串。 |
| result | 用于存放输出的 SHA-1 哈希值(40 字节的十六进制字符串)。 |
1.8.5