| Crates.io | secure-crypt |
| lib.rs | secure-crypt |
| version | 2.0.0 |
| created_at | 2026-01-10 09:44:00.533367+00 |
| updated_at | 2026-01-10 11:45:37.826163+00 |
| description | Ultra secure encryption/decryption tool using Rust + libsodium with zero secret leakage. |
| homepage | |
| repository | https://github.com/double12gzh/secure-crypt |
| max_upload_size | |
| id | 2033966 |
| size | 82,864 |
secure-crypt 安全加密/解密工具。
# 克隆仓库
git clone https://github.com/double12gzh/secure-crypt.git
cd secure-crypt
# 构建发布版本
cargo build --release
# 或使用提供的构建脚本
./build.sh
# 二进制文件位于
target/release/secure-crypt
cargo install --path .
生成 Ed25519 签名密钥对和 X25519 加密密钥对,并创建加密的私钥备份:
secure-crypt gen-keypair "Your Name" "your.email@example.com"
这将创建:
keystore/public_<fingerprint>.asc - Ed25519 公钥(Base64)keystore/x25519_public_<fingerprint>.asc - X25519 公钥(Base64)keystore/private_<fingerprint>.asc.enc - 加密的 Ed25519 私钥keystore/x25519_private_<fingerprint>.asc.enc - 加密的 X25519 私钥keystore/recovery_instructions_<fingerprint>.txt - 恢复说明生成指定长度的强密码(默认 32 字符):
secure-crypt gen-password [--length 32]
解密加密的私钥备份文件,恢复为明文私钥(DER 格式):
secure-crypt decrypt-private-key keystore/private_<fingerprint>.asc.enc [-o output.der]
使用 X25519 公钥加密文件(混合加密:X25519 + XChaCha20-Poly1305):
secure-crypt encrypt-file-with-key \
--input document.txt \
--public-key keystore/x25519_public_<fingerprint>.asc \
[--output document.txt.pubenc]
使用加密的 X25519 私钥解密文件:
secure-crypt decrypt-file-with-key \
--input document.txt.pubenc \
--private-key keystore/x25519_private_<fingerprint>.asc.enc \
[--output document.txt]
一键完成:生成密钥对 → 加密密钥 → 加密文件 → 签名文件:
secure-crypt encrypt \
--input document.txt \
--name "Your Name" \
--email "your.email@example.com" \
[--output document.txt.pubenc]
这将:
一键完成:解密密钥 → 解密文件 → 验证签名:
secure-crypt decrypt \
--input document.txt.pubenc \
--private-key keystore/x25519_private_<fingerprint>.asc.enc \
[--output document.txt]