Canonical: https://toolipedia.app/keyed-substitution-cipher-tool

# Keyed Substitution Cipher Tool

Encrypt and decrypt with Affine, Autokey, Beaufort, Gronsfeld, Porta, running key and keyed-alphabet substitution ciphers using a cipher selector, keeping case and punctuation.

Breadcrumbs: Toolipedia > Text tools > Text tools > Keyed Substitution Cipher Tool

## About Keyed Substitution Cipher Tool

Seven classical ciphers in one place, each worked out the way textbooks describe. Affine multiplies each letter number by a and adds b mod 26, for example a=5 and b=8 turns AFFINE CIPHER into IHHWVC SWFRCP. Autokey extends the key with the message itself, Beaufort subtracts the letter from the key, Gronsfeld shifts by digits, Porta uses 13 reciprocal alphabets, a running key uses a passage of text as the key, and the keyed-alphabet cipher scrambles the alphabet with a keyword. Case and punctuation can be kept.

## How to use Keyed Substitution Cipher Tool
1. Pick the cipher and whether to encrypt or decrypt.
2. Type the text and fill in the key fields that appear for that cipher.
3. Copy the result, optionally in groups of five letters.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
- Free to embed on your own website, with a ready-made code to copy.

## Also known as
- keyed substitution cipher tool
- affine cipher calculator
- autokey cipher
- beaufort cipher
- gronsfeld cipher
- porta cipher
- running key cipher

## Frequently asked questions

### Which values of a work for the affine cipher?

The number a must share no factor with 26, so it can be 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23 or 25. Otherwise two letters would encrypt to the same one and decryption would be impossible.

### Is the Beaufort cipher the same as Vigenère?

It uses the same square but subtracts the plaintext letter from the key letter, so the same operation encrypts and decrypts. Its results differ from a normal Vigenère.

### Are these ciphers safe for private messages?

No. They can be broken by hand or with frequency analysis, and are meant for puzzles, geocaching, teaching and history. Use modern authenticated encryption for anything private.

### Is Keyed Substitution Cipher Tool free?

Yes. Keyed Substitution Cipher Tool on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

### Can I put Keyed Substitution Cipher Tool on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

## Related tools

More free tools that go well with Keyed Substitution Cipher Tool:
- [Substitution Cipher / Cryptogram Solver Helper](https://toolipedia.app/substitution-cipher-cryptogram-solver-helper)
- [XOR, Vernam and One-Time Pad Cipher](https://toolipedia.app/xor-vernam-and-one-time-pad-cipher)
- [Square and Polygraphic Cipher Tool](https://toolipedia.app/square-and-polygraphic-cipher-tool)
- [Symbol Alphabet Ciphers](https://toolipedia.app/symbol-alphabet-ciphers)
- [Caesar cipher and ROT13 encoder and decoder](https://toolipedia.app/caesar-cipher)
