cipher.tools

A REST API designed to be fast, reliable and accurate. It implements 45+ classical ciphers and can be called from any website or programming language over HTTPS. Java developers can also skip the API and use the ciphers directly through the ciphertools-core Java library, available from Maven Central. Source code of the algorithms in use can be found at: https://gitlab.com/ciphertools

Disclaimer: The tools provided here are intended for learning, puzzles and entertainment. The ciphers are not secure, and should never be used to protect real data. Do not send any sensitive or private text (such as passwords, personal details or confidential messages) to this site. Requests may be logged, as text sent in query strings are visible in URLs, browser history and server logs.

https://cipher.tools/api/v1/encode

Request type: GET

This endpoint encodes text using any cipher implemented in ciphertools-core. The parameters are as follows:

Example

https://cipher.tools/api/v1/encode?cipher=caesar&key=2&plaintext=thequickbrownfoxjumpsoverthelazydog
https://cipher.tools/api/v1/encode?cipher=affine&key=5%2013&plaintext=onceinabluemoon&format=block:5,case:upper

The order of the formats matters: they are applied in the order they appear in the query string, so the same formats in a different order can produce different output. For example:

format=block:5&format=case:start produces Ndjeu Hkdpe Hdndg Eurtt
format=case:start&format=block:5 produces Ndjeu hkdpe hdndg eurtt

https://cipher.tools/api/v1/decode

Request type: GET

This endpoint decodes text using any cipher implemented in ciphertools-core. The parameters are as follows:

Example

https://cipher.tools/api/v1/decode?cipher=caesar&key=2&ciphertext=VJGSWKEMDTQYPHQZLWORUQXGTVJGNCBAFQI

https://cipher.tools/api/v1/ciphers

Request type: GET

This endpoint takes no arguments. It returns a list of all supported ciphers, including the IDs to use in the cipher parameter of the other endpoints.

Using in an Application

You can call the API from a web page using plain JavaScript (or a library of your choice), which lets you build a site around it.

const urlParams = new URLSearchParams({
  cipher: "caesar",
  key: 2,
  plaintext: "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG"
});

fetch("https://cipher.tools/api/v1/encode?" + urlParams).then(function(res) {
  return res.json();
}).then(function(data) {
  console.log(data.ciphertext);
  // > VJGSWKEMDTQYPHQZLWORUQXGTVJGNCBAFQI
});

On Linux-based systems, you can call the API from the command line with curl*.
* curl can also be installed on Windows machines

$ curl -X GET -H "Content-Type:application/json" -G \
  'https://cipher.tools/api/v1/encode' \
  -d cipher=caesar \
  -d key=2 \
  -d plaintext=THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG
$ {"normaltext":"THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG","ciphertext":"VJGSWKEMDTQYPHQZLWORUQXGTVJGNCBAFQI"}

All programming languages have an HTTPS client that can make GET requests. Some examples (not an exhaustive list) are: