TxtCipher: A Browser-Based Text Encryption Tool

TxtCipher is a simple, self-contained web application for encrypting and decrypting text. It runs entirely in the browser with no server, no installation, and no external dependencies. Just open the HTML file and start encrypting.

You can run it directly from the repository or download the file and open it locally.

What it does

TxtCipher uses the RC4 stream cipher with standard Base64 encoding to encrypt and decrypt text. You enter a password, type or paste your text, and click Encrypt or Decrypt. The result appears in the output field, ready to copy.

It is fully compatible with TxtCrypt, the macOS Objective-C application. Text encrypted with TxtCrypt can be decrypted with TxtCipher and vice versa.

There was also an Android version of TxtCrypt, but it is no longer available. TxtCipher can serve as a replacement, since it runs in any mobile browser and produces the same output.

Features

  • Single file: Everything (HTML, CSS, JavaScript) lives in one file. No build step, no frameworks, no npm install.
  • Works offline: Once loaded, it works without an internet connection thanks to a built-in service worker.
  • Dark and light mode: Toggle between themes with a button in the header.
  • Responsive layout: Works on desktop and mobile. On narrow screens, the panels stack vertically.
  • Visual feedback: The Encrypt and Decrypt buttons stay grayed out until both a password and input text are provided. The password byte count turns from red to green once you start typing.
  • Paste-friendly: Base64 input with embedded line breaks or spaces (common when pasting from email or chat) is handled gracefully.

A word of caution

RC4 is a legacy cipher that is considered cryptographically broken. TxtCipher exists for compatibility with TxtCrypt and for casual, non-sensitive use. Do not rely on it to protect confidential data. The application displays a prominent warning to this effect.

How to use it

  1. Open TxtCipher.html in any modern browser.
  2. Enter a password.
  3. Type or paste text into the Input field.
  4. Click Encrypt to get a Base64-encoded ciphertext, or paste ciphertext and click Decrypt to get the original text back.
  5. Use the Copy output button to copy the result to the clipboard, or Output to Input to feed the result back for further processing.

Technical details

The encryption works as follows: the password string is converted to its raw UTF-8 bytes (no hashing, no key derivation) and used directly as the RC4 key. The plaintext is also UTF-8 encoded, encrypted with RC4, and the resulting bytes are encoded as standard Base64. Decryption reverses the process. This matches TxtCrypt’s behavior exactly, which is what makes the two tools interoperable.

This tool was initially written with claude.ai and then refined using Claude Code.