ap-lib/cryptographer
最新稳定版本:1.0.0
Composer 安装命令:
composer require ap-lib/cryptographer
包简介
README 文档
README
Generate the passphrase once and save it securely in your configuration
IMPORTANT: Ensure this passphrase is stored in a secure location (e.g., environment variables, secrets manager)
PHP:
$algo = "aes-256-cfb"; $key_length = openssl_cipher_key_length(); $passphrase = openssl_random_pseudo_bytes($key_length); // if you're planing to save this to the environment, better to make base64 $passphrase_base64 = base64_encode($passphrase);
Bash:
echo $(openssl rand -base64 32)
Use cases:
| Algorithm | Integrity Check | Overhead | Usage Example |
|---|---|---|---|
| AES-256-GCM | ✅ Yes | 16-28 bytes, IV 12 bytes + Tag 4-12 bytes | Encrypting sensitive messages where data integrity is critical, e.g., API tokens. Storing sensitive configuration data with integrity protection. Optional authenticated additional data (AAD), not included in ciphertext but verified. |
| AES-256-CFB | ❌ No | 16 bytes, IV only | Streaming data encryption where low latency is required, e.g., video streaming. |
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-12