Last active
September 20, 2020 18:04
-
-
Save heartofrevel/9dd078053a336bdef6f7249011ef80c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.0", | |
"info": { | |
"title": "CipherPy", | |
"description": "APIs written in Python to encrypt and decrypt in various ciphers.", | |
"version": "1.0.0" | |
}, | |
"servers": [ | |
{ | |
"url": "https://apps.heartofrevel.com/cipherpy" | |
} | |
], | |
"tags": [ | |
{ | |
"name": "masc", | |
"description": "APIs under Mono Alphabetic Substitution Cipher", | |
"externalDocs": { | |
"description": "Blog Post for MASC", | |
"url": "https://blog.heartofrevel.com/2020/09/12/substitution-cipher-where-it-all-started/" | |
} | |
}, | |
{ | |
"name": "caesar-cipher", | |
"description": "APIs under Caesar Cipher", | |
"externalDocs": { | |
"description": "Blog", | |
"url": "https://blog.heartofrevel.com" | |
} | |
}, | |
{ | |
"name": "affine-cipher", | |
"description": "APIs under Affine Cipher", | |
"externalDocs": { | |
"description": "Blog", | |
"url": "https://blog.heartofrevel.com" | |
} | |
}, | |
{ | |
"name": "vigenere-cipher", | |
"description": "APIs under Vigenere Cipher", | |
"externalDocs": { | |
"description": "Blog", | |
"url": "https://blog.heartofrevel.com" | |
} | |
}, | |
{ | |
"name": "atbash-cipher", | |
"description": "APIs under Vigenere Cipher", | |
"externalDocs": { | |
"description": "Blog", | |
"url": "https://blog.heartofrevel.com" | |
} | |
} | |
], | |
"paths": { | |
"/masc/encrypt": { | |
"post": { | |
"tags": [ | |
"masc" | |
], | |
"summary": "Mono Alphabetic Substitution Cipher:Encrypt", | |
"description": "This API endpoint encrypts the given input using Mono Alphabetic Substitution Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/MascInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/requestBodies/ResponseOK" | |
} | |
} | |
} | |
}, | |
"400": { | |
"description": "INVALID INPUT", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/requestBodies/ResponseOK" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"/masc/decrypt": { | |
"post": { | |
"tags": [ | |
"masc" | |
], | |
"summary": "Mono Alphabetic Substitution Cipher:Decrypt", | |
"description": "This API endpoint decrypts the given input using Mono Alphabetic Substitution Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/MascInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/caesar/encrypt": { | |
"post": { | |
"tags": [ | |
"caesar-cipher" | |
], | |
"summary": "Caesar Cipher:Encrypt", | |
"description": "This API endpoint encrypts the given input using Caesar Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/CaesarInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/caesar/decrypt": { | |
"post": { | |
"tags": [ | |
"caesar-cipher" | |
], | |
"summary": "Caesar Cipher:Decrypt", | |
"description": "This API endpoint decrypts the given input using Caesar Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/CaesarInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/affine/encrypt": { | |
"post": { | |
"tags": [ | |
"affine-cipher" | |
], | |
"summary": "Affine Cipher:Encrypt", | |
"description": "This API endpoint encrypts the given input using Affine Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/AffineInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/affine/decrypt": { | |
"post": { | |
"tags": [ | |
"affine-cipher" | |
], | |
"summary": "Affine Cipher:Decrypt", | |
"description": "This API endpoint decrypts the given input using Affine Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/AffineInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/vigenere/encrypt": { | |
"post": { | |
"tags": [ | |
"vigenere-cipher" | |
], | |
"summary": "Vigenere Cipher:Encrypt", | |
"description": "This API endpoint encrypts the given input using Vigenere Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/VigenereInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/vigenere/decrypt": { | |
"post": { | |
"tags": [ | |
"vigenere-cipher" | |
], | |
"summary": "Vigenere Cipher:Decrypt", | |
"description": "This API endpoint decrypts the given input using Vigenere Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/VigenereInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/atbash/encrypt": { | |
"post": { | |
"tags": [ | |
"atbash-cipher" | |
], | |
"summary": "Atbash Cipher:Encrypt", | |
"description": "This API endpoint encrypts the given input using Atbash Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/AtbashInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/atbash/decrypt": { | |
"post": { | |
"tags": [ | |
"atbash-cipher" | |
], | |
"summary": "Atbash Cipher:Decrypt", | |
"description": "This API endpoint decrypts the given input using Atbash Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/AtbashInput" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/rot13/encrypt": { | |
"post": { | |
"tags": [ | |
"rot13-cipher" | |
], | |
"summary": "Rot13 Cipher:Encrypt", | |
"description": "This API endpoint encrypts the given input using Rot13 Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/Rot13Input" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
}, | |
"/rot13/decrypt": { | |
"post": { | |
"tags": [ | |
"rot13-cipher" | |
], | |
"summary": "Rot13 Cipher:Encrypt", | |
"description": "This API endpoint encrypts the given input using Rot13 Cipher", | |
"requestBody": { | |
"$ref": "#/components/requestBodies/Rot13Input" | |
}, | |
"responses": { | |
"200": { | |
"description": "OK" | |
}, | |
"400": { | |
"description": "INVALID INPUT" | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"requestBodies": { | |
"MascInput": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"required": [ | |
"input", | |
"key_ct", | |
"key_pt" | |
], | |
"type": "object", | |
"properties": { | |
"input": { | |
"type": "string", | |
"description": "Input to encrypt or decrypt", | |
"example": "HEARTOFREVEL IS A DEVELOPER" | |
}, | |
"key_pt": { | |
"type": "string", | |
"description": "Plain Text part of the key", | |
"example": "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
}, | |
"key_ct": { | |
"type": "string", | |
"description": "Cipher Text part of the key", | |
"example": "EJUBCHXSYNMPZQRAGOFLTIKDVW" | |
}, | |
"preserve_spaces": { | |
"type": "boolean", | |
"description": "This parameter indicates whether you can to preserve spaces in decryped plain text or encrypted cipher text.", | |
"example": true | |
} | |
} | |
} | |
} | |
} | |
}, | |
"CaesarInput": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"required": [ | |
"input", | |
"key" | |
], | |
"type": "object", | |
"properties": { | |
"input": { | |
"type": "string", | |
"description": "Input to encrypt or decrypt", | |
"example": "HEARTOFREVEL IS A DEVELOPER" | |
}, | |
"key": { | |
"type": "integer", | |
"description": "Key for number of shifts", | |
"example": 3 | |
}, | |
"preserve_spaces": { | |
"type": "boolean", | |
"description": "This parameter indicates whether you can to preserve spaces in decryped plain text or encrypted cipher text.", | |
"example": true | |
} | |
} | |
} | |
} | |
} | |
}, | |
"AffineInput": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"required": [ | |
"input", | |
"key1", | |
"key2" | |
], | |
"type": "object", | |
"properties": { | |
"input": { | |
"type": "string", | |
"description": "Input to encrypt or decrypt", | |
"example": "HEARTOFREVEL IS A DEVELOPER" | |
}, | |
"key1": { | |
"type": "integer", | |
"description": "key1 should be prime length of input, check blog page for more info", | |
"example": 1 | |
}, | |
"key2": { | |
"type": "integer", | |
"description": "Any number", | |
"example": 1 | |
}, | |
"preserve_spaces": { | |
"type": "boolean", | |
"description": "This parameter indicates whether you can to preserve spaces in decryped plain text or encrypted cipher text.", | |
"example": true | |
} | |
} | |
} | |
} | |
} | |
}, | |
"VigenereInput": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"required": [ | |
"input", | |
"key" | |
], | |
"type": "object", | |
"properties": { | |
"input": { | |
"type": "string", | |
"description": "Input to encrypt or decrypt", | |
"example": "HEARTOFREVEL IS A DEVELOPER" | |
}, | |
"key": { | |
"type": "string", | |
"description": "string keyword to encrypt with", | |
"example": "REVEL" | |
}, | |
"preserve_spaces": { | |
"type": "boolean", | |
"description": "This parameter indicates whether you can to preserve spaces in decryped plain text or encrypted cipher text.", | |
"example": true | |
} | |
} | |
} | |
} | |
} | |
}, | |
"AtbashInput": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"required": [ | |
"input" | |
], | |
"type": "object", | |
"properties": { | |
"input": { | |
"type": "string", | |
"description": "Input to encrypt or decrypt", | |
"example": "HEARTOFREVEL IS A DEVELOPER" | |
}, | |
"preserve_spaces": { | |
"type": "boolean", | |
"description": "This parameter indicates whether you can to preserve spaces in decryped plain text or encrypted cipher text.", | |
"example": true | |
} | |
} | |
} | |
} | |
} | |
}, | |
"Rot13Input": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"required": [ | |
"input" | |
], | |
"type": "object", | |
"properties": { | |
"input": { | |
"type": "string", | |
"description": "Input to encrypt or decrypt", | |
"example": "HEARTOFREVEL IS A DEVELOPER" | |
}, | |
"preserve_spaces": { | |
"type": "boolean", | |
"description": "This parameter indicates whether you can to preserve spaces in decryped plain text or encrypted cipher text.", | |
"example": true | |
} | |
} | |
} | |
} | |
} | |
}, | |
"ResponseOK": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"plain_text": { | |
"type": "string", | |
"description": "Resulting Plain Text", | |
"example": "PLAINTEXT" | |
}, | |
"cipher_text": { | |
"type": "string", | |
"description": "Resulting Cipher Text", | |
"example": "ENCRYPTED" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment