cipher

command module
v0.0.0-...-bd69d09 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2022 License: MIT Imports: 6 Imported by: 0

README ยถ

CipherAPI ยท GitHub license PRs Welcome

CipherAPI is an open API for encoding and decoding text using post requests ๐Ÿ‘ ๐Ÿ ๐ŸŒŸ.

Ciphers are methods to encode information with the purpose secure data or the message. They have been used since historical times, and they have evolved now to modern cryptography that is used everywhere for safe applications and data handling.

Useful for cases where you need to encode or decode data (more advanced methods coming soon), or for teaching purposes.

Zodiac cipher

Index

Usage

Cipher API can be used three ways:

Using Post Requests

The simplest way to try it out and the way it's meant to be used. As a public API you can do POST requests:

curl -X POST https://ciphertapi.herokuapp.com/encode/morse -H Content-Type:application/json -d '{"text":"Hello world"}'
const response = await fetch("https://ciphertapi.herokuapp.com/encode/morse", {
    method: "POST",
    headers: { "content-type": "application/json"},
    body: JSON.stringify({
        text: "Hello world"
    }),
})
const data = await response.text();

if (!response.ok) {
    alert(data);
} else {
    console.log(data);
}
Website

Provides a full deployed website so you can try all methods for encoding! It saves your historical encodings with user sessions :)

Locally

If you wish try it on your own and modify it freely, please refer to installation.

package main

import (
 "github.com/cheveuxdelin/cipher/atbash"
 "github.com/cheveuxdelin/cipher/caesar"
 "github.com/cheveuxdelin/cipher/morse"
)

func main() {
        //Using different methods for encoding/decoding
        encoded, err := morse.Encode("Hello world")

        if err != nil {
            fmt.Println(err)
        }

        decoded, err := morse.Decode("Hello world")

        if err != nil {
            fmt.Println(err)
        }

        fmt.Println(encoded, decoded)
}

Installation

Make sure you have Go installed.

If you do wish to run the server locally, run this command to clone the project

git clone https://github.com/cheveuxdelin/cipher.git

And then run this command on the cloned project to start the server in your local workspace

go run main.go

And thats it! you can now make requests on port :8080, or if you can change the port if you need to

API

All methods support both actions encode and decode.

โ— marked as required:

Method Parameters
Morse text โ—
Caesar text โ—, n โ—, onlyLetters
Atbash text โ—

New methods are expected to be added soon, so make sure to star the project and keep an eye on it ๐ŸŒฑ โ˜€

gif

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL