CODE-X Encryption
This API provides access to code obfuscation and encryption. It supports JavaScript (via advanced obfuscation), Python & Java (via Base64 encoding). It can be used to protect code and keys before distribution.
Endpoint
Section titled “Endpoint” POST
/api/v1/codex Request Parameters
Section titled “Request Parameters”The following parameters are accepted in the request body:
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | The raw source code string to be obfuscated/encrypted. |
lang | string | Yes | The language of the code. Options: js, javascript, py, java. |
Request Examples
Section titled “Request Examples”Choose your preferred method to interact with the CODE-X API:
curl -X POST https://heavstal.com.ng/api/v1/codex \-H "Content-Type: application/json" \-H "x-api-key: <YOUR_API_KEY>" \-d '{"lang": "js", "code": "function hello() { console.log(\"Secret Code\"); }"}'const response = await fetch('https://heavstal.com.ng/api/v1/codex', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify({ lang: "js", code: "function hello() { console.log('Secret Code'); }" })});
const res = await response.json();console.log(res.data);import { tools } from '@heavstal/api';
const obfuscated = await tools.codex("function hello() { console.log('Secret'); }", "js");console.log(obfuscated.encrypted_code);import requests
url = "https://heavstal.com.ng/api/v1/codex"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}payload = { "lang": "js", "code": "function hello() { print('Secret Code') }"}
response = requests.post(url, headers=headers, json=payload)print(response.json()["data"])Response Examples
Section titled “Response Examples”{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "language": "js", "encrypted_code": "var _0x5f2d=['log','...'];(function(_0x2d8f05,_0x4b81bb){..." }}{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "language": "py", "encrypted_code": "cHJpbnQoIkhlbGxvIFdvcmxkIik=" }}{ "status": "error", "error": "Unsupported language provided. Use 'js', 'py', or 'java'."}