FlareonzVerse

I'm       written       in       c++

↩ back

Hexel 16 - IPv6 Like Cipher

coding

About

There’s no particular background story for this program, I mean, I did it for fun and because I was bored. It is pretty simple, just takes each characters and converts it to a hex value, adding some ‘:’ so make it look like an IPv6 address. This is somehow better than Asback 14 since this tool supports any character and therefore you can write whatever you want.

Usage

Just copy the entire code below and create a new bookmark on your browser. Instead of a link, replace it with javascript: [paste code] and then click on save. You just have to click on the bookmark to run it and the results will be copied to the clipboard automatically.

c4:f6:f6:b6:02:36:f6:f6:c6:02:27:96:76:86:47:f3:e06f1

Also on my GitHub

function cocli(text) {
    at = 0;
    do {
        at += 1;
        elem = document.createElement("textarea");
        elem.value = text;
        document.body.appendChild(elem);
        elem.select();
        copied = document.execCommand("copy");
        document.body.removeChild(elem);
    } while (!copied && (at < 50));
    try {
        copy(text);
    } catch (error) {
        console.log(error);
    }
    try {
        navigator.clipboard.writeText(text);
    } catch (error) {
        console.log(error);
    }
}

function hexel16_e(text = "") {
    if (text == "") {
        alert("[hexel16] [x] A non empty text must be provided!");
        throw "[hexel16] [x] A non empty text must be provided!";
    }
    preoutput = "";
    output = "";
    for (i = 0; i < text.length; i++) {
        if (i != 0) {
            preoutput += ":";
        }
        preoutput += text.codePointAt(text.length - 1 - i).toString(16);
    }
    for (i = 0; i < preoutput.length; i++) {
        output += preoutput.charAt(preoutput.length - 1 - i);
    }
    return output;
}

function hexel16_d(text = "") {
    if (text == "") {
        alert("[hexel16] [x] A non empty text must be provided!");
        throw "[hexel16] [x] A non empty text must be provided!";
    }
    if (!(text.indexOf(":") >= 0)) {
        alert("[hexel16] [x] A valid hexel16 encrypted text must be provided!");
        throw "[hexel16] [x] A valid hexel16 encrypted text must be provided!";
    }
    preoutput = "";
    output = "";
    for (i = 0; i < text.length; i++) {
        preoutput += text.charAt(text.length - 1 - i);
    }
    inarray = preoutput.split(":");
    for (i = 0; i < inarray.length; i++) {
        output += String.fromCodePoint(parseInt(inarray[inarray.length - 1 - i], 16));
    }
    return output;
}

function hexel16_main() {
    option = confirm("[hexel16] [o] HEXEL 16 ENCODING TOOL\n[hexel16] [o] Press OK to Encode\n[hexel16] [o] Press CANCEL to Decode");
    if (option) {
        enc = hexel16_e(prompt("[hexel16] [o] Input text to be encrypted:"));
        cocli(enc);
        cocli(enc);
        cocli(enc);
        alert("[hexel16] [o] Text has been encoded!\n\n" + enc);
    } else {
        dec = hexel16_d(prompt("[hexel16] [o] Input text to be decrypted:"));
        cocli(dec);
        cocli(dec);
        cocli(dec);
        alert("[hexel16] [o] Text has been decoded!\n\n" + dec);
    }
}
hexel16_main();

↩ back LinkTree ⤴ top
•   © 2024 Flareonz44   •   LinkTree   •