hai-crypto

Provide encryption, signing, hashing, and key management for Node.js and browsers.

3|7|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/hai-series/hai-framework --skill hai-crypto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hai-crypto
Source: https://github.com/hai-series/hai-framework/tree/main/packages/cli/templates/skills/hai-crypto
Command: npx skills add https://github.com/hai-series/hai-framework --skill hai-crypto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

使用 @h-ai/crypto 提供非对称加密、哈希、对称加密与密码哈希能力,覆盖 Node.js 与浏览器环境,帮助开发者实现安全数据处理和密钥管理。

Core Features & Use Cases

  • Asymmetric and symmetric encryption: 生成密钥对、加密/解密、签名与验签,适用于数据保护与身份验证场景。
  • Hashing and password storage: 提供哈希和密码验证,确保凭证安全存储。
  • Key management and cross-environment support: 支持浏览器与服务端环境,便于跨端安全实现。

Quick Start

Initialize the crypto module and perform a sample encryption or hashing operation.

Frequently Asked Questions about hai-crypto

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement end-to-end encryption and signing across Node.js and browser environments?

End-to-end encryption and signing across Node.js and browser environments is handled by initializing the crypto module to generate key pairs, encrypt data, and verify signatures. It ensures secure data transmission and identity verification cross-platform.

What is the best way to securely store user passwords using hashing?

Securely storing user passwords using hashing involves applying a dedicated password hashing API to hash credentials before storage. This approach ensures safe password verification and protects sensitive user data without exposing plaintext.

Can I use asymmetric and symmetric encryption in the same application for secure data transmission?

Asymmetric and symmetric encryption can be used together in the same application for secure data transmission. The module provides a broad API surface to generate key pairs, encrypt payloads, and sign data for comprehensive protection.

Does this crypto library support key management and initialization lifecycle handling?

Key management and initialization lifecycle handling are supported natively by the crypto library. It manages secure key handling and provides structured error handling via HaiResult to ensure robust cryptographic operations.

How do I verify identity and ensure data integrity with digital signing?

Verifying identity and ensuring data integrity with digital signing requires generating a cryptographic key pair to sign the payload and then validating the signature. This mechanism confirms the sender's identity and protects against tampering.

Why does cross-platform cryptography implementation often fail without unified error handling?

Cross-platform cryptography implementation often fails without unified error handling due to environment-specific API discrepancies. This module resolves those issues by standardizing operations and returning structured HaiResult objects for consistent error management.