Skip to content
cosmodev ~/tools/text-encryptor

文本加密器

Privacy & Security

使用密码通过 AES-256-GCM 加密或解密文本。安全分享密文——只有持有密码的人才能读取。

AES-256-GCM · 100% 客户端

使用 PBKDF2(100,000 次迭代)派生密钥。密码不会离开本页面,也不会包含在分享链接中。

输入消息和口令以进行加密。

功能说明

文本加密器用密码锁定任意文本,采用 AES-256-GCM - 与 TLS 和全盘加密使用的认证加密标准相同。粘贴一条消息,选择一个密码,你会得到一段紧凑的 Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. 密文,可以存储在任何地方,或通过任何渠道发送 - 邮件、聊天、工单。只有知道密码的人才能把它还原成可读文本。

密钥由你的密码通过 PBKDF2 派生(SHA-256,100,000 次迭代,每次都生成全新的 16 字节盐),因此相同的消息永远不会产生相同的密文,字典攻击也被设计本身拖慢。一切 100% 在浏览器中客户端运行:文本和密码都不会被发送到任何服务器。

使用方法

  1. 用左上角的 Encrypt / Decrypt 切换开关选择模式。
  2. 在输入框中输入或粘贴文本 - 加密时是明文,解密时是 Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. 密文。
  3. 输入密码。用眼睛按钮显示或隐藏密码。
  4. 点击 Encrypt(或 Decrypt)。结果显示在输出框中,旁边带一个 Copy 按钮。
  5. 加密完成后,点击 Share ciphertext link 复制一条携带密文(绝不包含密码)的 URL。

示例

加密一条秘密信息

输入:Meet me at the airlock at 21:00,密码 reactor-key

输出(每次运行都不同 - 每次都有新的盐和 IV):

Q5xJ0mF3nM2c0kqTzZLBM1rsRXd6lt4+pQa2S/YVzpvxv1CVKJnOGh3tWlFcT9m+HGM=

解密还原

切换到 Decrypt,粘贴 Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. 字符串,输入 reactor-key → Meet me at the airlock at 21:00。

错误密码

粘贴同一段密文,密码输成 wrong-key → Decryption failed - wrong password or corrupted ciphertext。

补充说明

  • 经过认证: AES-GCM 附加一个 16 字节的认证标签,因此被篡改的密文会被检测并拒绝,而不是解密成乱码。
  • 格式: Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. 输出打包了 salt (16B) + IV (12B) + ciphertext + tag - 一个自包含的字符串,不需要任何带外元数据。
  • 私密: 100% 在客户端运行 - 适合秘密信息。分享链接只包含密文,绝不包含密码;请通过另一个渠道发送密码。
  • 相关工具: Password Generator(选一个强密码)、HashHashA one-way function that maps data of any size to a fixed-length digest. Same input, same digest; any change, different digest; not reversible. Generator、Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt. Encode / Decode。
源代码14 种语言

100% 客户端运行 · 你的数据永远不会离开浏览器。 觉得好用?分享给同事吧。