@guohanmin/encryptor
v1.0.0共享加密工具库:MD5、SHA-256/SHA-512、HMAC-SHA256、AES(CBC/GCM)、RSA、ECC
pnpm add @guohanmin/encryptor25 public exports, grouped by kind.
Functions
- aesDecryptFunction
AES-CBC 解密(Pkcs7 填充)。
View details - aesEncryptFunction
AES-CBC 加密(Pkcs7 填充)。
View details - aesGcmDecryptFunction
AES-GCM 解密,基于原生 Web Crypto。
View details - aesGcmEncryptFunction
AES-GCM 加密,基于原生 Web Crypto(认证标签已附加在密文末尾)。
View details - aesGcmGenerateKeyFunction
生成 AES-GCM 密钥(Base64 字符串),基于原生 Web Crypto。
View details - aesGenerateIVFunction
生成 AES-CBC 初始向量(16 字节,十六进制字符串)。
View details - aesGenerateKeyFunction
生成 AES-CBC 密钥(十六进制字符串)。
View details - eccDeriveSharedSecretFunction
ECDH 密钥协商:基于己方私钥与对方公钥推导共享密钥。
View details - eccGenerateKeyPairFunction
生成 ECC 密钥对,基于原生 Web Crypto(ECDSA 密钥,可复用于签名与 ECDH 密钥协商)。
View details - eccSignFunction
ECDSA 签名(SHA-256)。
View details - eccVerifyFunction
ECDSA 验签(SHA-256)。
View details - hmacSHA256Function
计算消息的 HMAC-SHA256 摘要。
View details - md5HashFunction
计算字符串的 MD5 摘要。
View details - rsaDecryptFunction
RSA 私钥解密。
View details - rsaEncryptFunction
RSA 公钥加密。
View details - rsaGenerateKeyPairFunction
生成 RSA 密钥对(同步)。
View details - rsaSignFunction
RSA 私钥签名(SHA-256)。
View details - rsaVerifyFunction
RSA 公钥验签(SHA-256)。
View details - sha256HashFunction
计算字符串的 SHA-256 摘要。
View details - sha512HashFunction
计算字符串的 SHA-512 摘要。
View details