|
Console Library 8.0.0
A header-only library that makes C++ simple
|
密码学相关的命名空间。 More...
Namespaces | |
| namespace | sha256_impl |
| SHA256哈希算法的内部实现细节。 | |
| namespace | md5_impl |
| MD5哈希算法的内部实现细节。 | |
| namespace | aes_impl |
| AES加密算法的内部实现细节。 | |
Functions | |
| std::string | sha256 (const std::string &input) |
| 计算输入字符串的SHA256哈希值。 | |
| std::string | file_sha256 (const std::string &filename) |
| 计算文件的SHA256哈希值。 | |
| std::string | md5 (const std::string &input) |
| 计算输入字符串的MD5哈希值。 | |
| std::string | base64_encode (const std::string &input) |
| 对输入字符串进行Base64编码。 | |
| std::string | base64_decode (const std::string &input) |
| 对Base64编码的字符串进行解码。 | |
| std::string | aes_encrypt (const std::string &plaintext, const std::string &key) |
| 使用AES-128-CTR模式加密明文。 | |
| std::string | aes_decrypt (const std::string &ciphertext, const std::string &key) |
| 使用AES-128-CTR模式解密密文。 | |
密码学相关的命名空间。
|
inline |
使用AES-128-CTR模式解密密文。
| ciphertext | Base64编码的密文字符串,包含前16字节的初始化向量。 |
| key | 解密密钥,必须与加密时使用的密钥相同。 |
|
inline |
使用AES-128-CTR模式加密明文。
加密过程使用CTR计数器模式,初始化向量通过对密钥进行SHA256哈希后取前16字节生成。
| plaintext | 要加密的明文字符串。 |
| key | 加密密钥,将自动填充或截断至16字节。 |
|
inline |
对Base64编码的字符串进行解码。
| input | Base64编码的字符串。 |
|
inline |
对输入字符串进行Base64编码。
| input | 要编码的原始字符串。 |
|
inline |
计算文件的SHA256哈希值。
| filename | 要计算哈希的文件路径。 |
|
inline |
计算输入字符串的MD5哈希值。
| input | 要计算哈希的输入字符串。 |
|
inline |
计算输入字符串的SHA256哈希值。
| input | 要计算哈希的输入字符串。 |