cipher.tools

A REST API designed to be fast, reliable and accurate. 45+ classical ciphers implemented compatible with any programming language over https.
Please note this is still a work in progress, you might find some bugs or rough edges. Please report them at https://gitlab.com/ciphertools

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

Request Type: GET
This endpoint allows you to encode in any cipher specified 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

Formatting order matters, it will apply the formats in order of appearance in the query string

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 allows you to encode in any cipher specified 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

No arguments required returns.

Using in an Application

For linux based systems the curl* command can be executed from the CMD line to make calls to the API.
* curl can be installed on Windows machines too

$ 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"}

You can call the API using vanilla javascript and build a site around it

fetch("https://cipher.tools/api/v1/encode?cipher=caesar&key=2&plaintext=THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG").then(function(res) {
    return res.json();
}).then(function(data) {
   console.log(data.ciphertext);
   # > VJGSWKEMDTQYPHQZLWORUQXGTVJGNCBAFQI
});

Using the popular javascript extension jQuery you can easily make calls to the API.

$.getJSON(
  "https://cipher.tools/api/v1/encode", {
    cipher: "caesar",
    key: 2,
    plaintext: "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG",
  }, function(data) {
    console.log(data.ciphertext);
    # > VJGSWKEMDTQYPHQZLWORUQXGTVJGNCBAFQI
  }
);

Other languages should have https implementations which allow GET requests, some examples are but not limited to: