加密 a large file with AES in chunks
加密 files too large for a single AES operation by processing them in chunks with a streaming mode, then decrypt to recover.
- 1
为大 files (hundreds 的 MB 或 GB), loading 一切为 内存为 单个 AES 调用是 impractical. 过程 file 在固定-大小 chunks (e.g. 1 MiB), 每个具有其 own IV, 和 concatenate ciphertext chunks.
- 2 AES 加密器 →
为每个块: derive 键一次 (从 passphrase), 生成 fresh IV per 块, 加密, 和输出 IV || ciphertext 为该 块. 键 derivation 是 amortized — 它一次.
- 3 AES 解密器 →
到解密: 为每个 IV || ciphertext 块, 解密具有相同键 和 IV, 然后 concatenate plaintext chunks 在 order.
- 4 Base64 编码器 →
如果 encrypted 输出必须是 文本-安全 (为 JSON 或 email), Base64-编码每个块 或完整 ciphertext.
- 5
Use GCM 或 CTR 模式为 streaming — 它们不 require padding 和支持并行加密. 从不 use ECB. 为已认证 streaming, use GCM per 块或 加密-then-MAC 整个 file.
常见问题
- 为什么生成新 IV 为每个块?
- Reusing IV 具有相同键 在 GCM 或 CTR 模式是 catastrophic — 它 reveals XOR 的 plaintexts. fresh random IV per 块 (stored 具有 ciphertext) prevents 此. 在 CBC, IV reuse leaks XOR 的第一 blocks.
- 如何 I 验证 decrypted file matches 原始?
- 计算 a SHA-256 hash of the original before encryption and of the decrypted result. If the hashes match, the round-trip is lossless. For tamper detection, store the hash alongside the ciphertext.
解决此任务的工作流
Ascii85 转 Base64
将 Ascii85 解码并重新编码为 Base64。 管道
Base2048 转 Base64
将 Base2048 解码并重新编码为 Base64。 管道
Base32 转 Base64
将 Base32 编码字符串解码为原始字节,再编码为 Base64 以获得更紧凑的表示。 管道
Base58 转 Base64
将 Base58 解码并重新编码为 Base64。 管道
Base64 编码→解码→验证
将文本编码为 Base64 再解码回来,验证往返过程完整保留原始数据。 管道
Blowfish 加密后 Base64
Blowfish 加密后 Base64 编码用于文本安全传输。 管道
DES 加密后 Base64
DES 加密后 Base64 编码用于传统兼容。 管道
为 URL 传输编码 JSON 载荷
将 JSON 文档准备为 URL 参数:格式化、Base64 编码、再百分号编码——即嵌套参数解码链的精确逆过程。 管道
AES 加密后 Base64 编码
用 AES 加密明文并将密文编码为 Base64 以便文本安全传输。 管道
内容哈希并 Base64 编码
计算输入哈希并将摘要编码为 Base64 以便紧凑传输。 管道
Hex 转 Base64
将十六进制字符串解码为原始字节,再编码为 Base64 以便紧凑传输。 管道
HMAC 签名后 Base64 编码
生成 HMAC 签名后 Base64 编码,用于 API 认证头。 管道
摩尔斯编码并 Base64 传输
将文本编码为摩尔斯码后 Base64 编码用于数字传输。 管道
RC4 加密后 Base64
RC4 加密后 Base64 编码。 管道
RIPEMD-160 哈希后 Base64
计算 RIPEMD-160 哈希后 Base64 编码。 管道
文本打乱后 Base64 编码
打乱文本字符后 Base64 编码。 管道
Unicode 转义并 Base64 编码
Unicode 转义文本后 Base64 编码用于 ASCII 安全传输。 管道
URL 编码后 Base64 双重编码
URL 编码后 Base64 编码用于 API 负载双重编码。 管道
UUencode 后 Base64
UUencode 文本后 Base64 编码结果。 管道
生成 UUID 并 Base64 编码
生成 UUID 后 Base64 编码用于紧凑存储。 管道
相关工具
AES 加密器
使用 Web Crypto API 以 AES(CBC/GCM/ECB)加密文本或二进制数据。免费、隐私优先、100% 纯客户端运行。 工具
AES 解密器
使用 Web Crypto API 解密 AES 加密数据(CBC/GCM/ECB)。免费、隐私优先、100% 纯客户端运行。 工具
Base64 编码器
将文本或二进制数据编码为 Base64。免费、隐私优先、100% 纯客户端运行。支持 UTF-8、ASCII、Latin1、UTF-16LE 字符集,可处理多语言文本与二进制内容,结果可直接用于 Data URI、邮件附件、JWT 等场景。 工具
哈希计算器
计算 MD5、SHA-1、SHA-256 或 SHA-512 哈希,支持十六进制或 Base64 输出。免费、隐私、100% 客户端运行。SHA-256/512 基于 Web Crypto API,MD5 基于 spark-md5,适用于校验和、完整性验证、指纹识别等场景。MD5 与 SHA-1 已不适用于安全场景。 工具