โก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.
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.
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"
}
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"
}
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
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);
}
}
- Install packages
npm install
- 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.
- 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.
- Launch tests
npm run test
- Create a production build
npm run build
- Runs the server of production build
npm start
Open http://localhost:5000 to view it in the browser.