NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
aes256.hpp
浏览该文件的文档.
1#ifndef NEFORCE_CORE_ENCRYPT_AES256_HPP__
2#define NEFORCE_CORE_ENCRYPT_AES256_HPP__
3
11
14NEFORCE_BEGIN_NAMESPACE__
15
20
71
200
201
208NEFORCE_ALWAYS_INLINE_INLINE string aes256_encrypt(const string_view data, const string_view key_hex) {
209 return AES256::encrypt_ecb_hex(data, key_hex);
210}
211
212NEFORCE_ALWAYS_INLINE_INLINE string aes256_encrypt(const string& data, const string_view key_hex) {
213 return AES256::encrypt_ecb_hex(data.view(), key_hex);
214}
215
216NEFORCE_ALWAYS_INLINE_INLINE string aes256_encrypt(const string_view data, const string& key_hex) {
217 return AES256::encrypt_ecb_hex(data, key_hex.view());
218}
219
220NEFORCE_ALWAYS_INLINE_INLINE string aes256_encrypt(const string& data, const string& key_hex) {
221 return AES256::encrypt_ecb_hex(data.view(), key_hex.view());
222}
223
230NEFORCE_ALWAYS_INLINE_INLINE string aes256_decrypt(const string_view encrypted_hex, const string_view key_hex) {
231 return AES256::decrypt_ecb_hex(encrypted_hex, key_hex);
232}
233
234NEFORCE_ALWAYS_INLINE_INLINE string aes256_decrypt(const string& encrypted_hex, const string_view key_hex) {
235 return AES256::decrypt_ecb_hex(encrypted_hex.view(), key_hex);
236}
237
238NEFORCE_ALWAYS_INLINE_INLINE string aes256_decrypt(const string_view encrypted_hex, const string& key_hex) {
239 return AES256::decrypt_ecb_hex(encrypted_hex, key_hex.view());
240}
241
242NEFORCE_ALWAYS_INLINE_INLINE string aes256_decrypt(const string& encrypted_hex, const string& key_hex) {
243 return AES256::decrypt_ecb_hex(encrypted_hex.view(), key_hex.view());
244}
245 // AES256
247 // Encryption
249
250NEFORCE_END_NAMESPACE__
251#endif // NEFORCE_CORE_ENCRYPT_AES256_HPP__
constexpr view_type view() const noexcept
获取字符串视图
string aes256_encrypt(const string_view data, const string_view key_hex)
AES-256加密便捷函数
string aes256_decrypt(const string_view encrypted_hex, const string_view key_hex)
AES-256解密便捷函数
vector< byte_t > byte_vector
字节向量类型别名
unsigned char byte_t
字节类型,定义为无符号字符
memory_view< const byte_t > cbyte_view
常量字节视图类型别名
basic_string_view< char > string_view
字符字符串视图
constexpr decltype(auto) data(Container &cont) noexcept(noexcept(cont.data()))
获取容器的底层数据指针
字符串类型别名和实用函数
AES-256加密算法结构体
static byte_vector decrypt_cbc_pkcs7(cbyte_view data, cbyte_view key, cbyte_view iv)
AES-256-CBC 解密(PKCS7填充)
static string encrypt_ecb_hex(string_view data, string_view key_hex)
AES-256-ECB 加密(十六进制接口)
static byte_vector decrypt_cbc(cbyte_view data, cbyte_view key, cbyte_view iv)
AES-256-CBC 解密
static byte_vector encrypt_cbc_pkcs7(cbyte_view data, cbyte_view key, cbyte_view iv)
AES-256-CBC 加密(PKCS7填充)
static byte_vector encrypt_ecb_pkcs7(cbyte_view data, cbyte_view key)
AES-256-ECB 加密(PKCS7填充)
static byte_vector encrypt_cbc(cbyte_view data, cbyte_view key, cbyte_view iv)
AES-256-CBC 加密
static byte_vector encrypt_ecb(cbyte_view data, cbyte_view key)
AES-256-ECB 加密
static byte_vector decrypt_ecb_pkcs7(cbyte_view data, cbyte_view key)
AES-256-ECB 解密(PKCS7填充)
static byte_vector decrypt_gcm(cbyte_view data, cbyte_view key, cbyte_view iv, cbyte_view aad, cbyte_view tag, size_t tag_len)
AES-256-GCM 解密并验证标签
static string decrypt_ecb_hex(string_view encrypted_hex, string_view key_hex)
AES-256-ECB 解密(十六进制接口)
static byte_vector encrypt_gcm(cbyte_view data, cbyte_view key, cbyte_view iv, cbyte_view aad, byte_t *tag, size_t tag_len)
AES-256-GCM 加密
static byte_vector decrypt_ecb(cbyte_view data, cbyte_view key)
AES-256-ECB 解密
动态大小数组容器