Skip to main content

Crate sz_orm_crypto

Crate sz_orm_crypto 

Source
Expand description

§SZ-ORM Crypto — 加密工具

提供常用密码学原语:AES-256-GCM 对称加密、HMAC-SHA256 消息认证码、 PBKDF2 密钥派生与 SHA-256 哈希,所有实现基于 RustCrypto,保证常数时间比较。

§主要函数

  • sha256 / sha256_hex — SHA-256 哈希
  • AES-256-GCM 加解密
  • HMAC-SHA256 与 PBKDF2

Structs§

AesGcmCrypter
AES-256-GCM 加密器(密码学安全)
HmacSigner
HMAC-SHA256 API 签名器
Pbkdf2Hasher
PBKDF2-HMAC-SHA256 密码哈希器(基于 RustCrypto pbkdf2 crate)

Enums§

CryptoError

Traits§

ApiSigner
Crypter
PasswordHasher

Functions§

hmac_sha256
HMAC-SHA256 (RFC 2104, 基于 RustCrypto hmac crate)
hmac_sha256_hex
HMAC-SHA256 十六进制字符串
sha256
计算 SHA-256 哈希(基于 RustCrypto sha2)
sha256_hex
计算 SHA-256 并返回十六进制字符串