Giter VIP home page Giter VIP logo

classify's Introduction

๐Ÿ”‘ Classify

Website GitHub repo size GitHub contributions welcome

โšกTelegram bot now availableโšก

Classify is open source project for enrypting text messages. Encryption is based on a simple and clear "One-time pad" method. The essence of this method is to apply the "exclusive OR" operation for each ASCII code of the message symbol in binary form and the corresponding ASCII code of the secret key.

๐Ÿ‘“ API overview

Classify API provides unlimited access to encoding and decoding text messages using a given key. You can freely use the endpoints of this API to create your own apps.

๐Ÿ”’ Encrypting data

This endpoint accepts text message data and a secret key as input. At the output, the user receives a JSON object with an encoded message.

POST https://classify-web.herokuapp.com/api/encrypt
Content-Type:  application/json; charset=utf-8
{
    "data": "Your message",
    "key": "Your key"
}

๐Ÿ”“ Decrypting data

This endpoint accepts an encrypted text message and a secret key as input. At the output, the user receives a JSON object with a decrypted message.

POST https://classify-web.herokuapp.com/api/decrypt
Content-Type:  application/json; charset=utf-8
{
    "data": "Encrypted message",
    "key": "Secret key"
}

๐Ÿ”‘ Keygen

The reliability of the encrypted message depends on the specified key. Ideally, the key should be randomly generated and have a message length. To do this, you can use our built-in key generator.

GET https://classify-web.herokuapp.com/api/keygen

Key length parameter:

?length=32

Presence of symbols (1 - true, 0 - false):

?symbols=1

๐ŸŽฏ Examples

JavaScript:

async function encryptData() {
    try {
        const url = 'https://classify-web.herokuapp.com/api/encrypt';
        const jsonData = JSON.stringify({ 
            data: "Hello world!", key: "secret"
        });
        let response = await fetch(url, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
            body: jsonData
        });
        const result = await response.json();
        console.log(result);
    } catch (error) {
        console.error(error);
    }
}

โšก Launch local server

  1. Install packages
npm install
  1. Create .env file with secret key
SECRET_KEY=CreateReliableKeyUsingRandomGenerator

โš ๏ธ โš ๏ธ โš ๏ธ Classify uses double encryption. This means that after encrypting the message with your key, the received encrypted message is encrypted again with the key that is defined in the .env file. Therefore, each created copy of the application will have its own built-in key, and will not support decryption of encrypted messages from another copies of application.

  1. Runs the server with Nodemon for development
npm run dev

The page will reload if you make edits.
You will also see any lint errors in the console.
Open http://localhost:5000 to view it in the browser.

  1. Launch tests
npm run test
  1. Create a production build
npm run build
  1. Runs the server of production build
npm start

Open http://localhost:5000 to view it in the browser.

classify's People

Contributors

cheatsnake avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.