JavaScript Substitution Cypher

   Simple JavaScript Substitution Cipher  

   A Substitution Cipher is an Encryption method in which units of the plaintext (generally single letters or pairs of letters of ordinary text) are replaced with other symbols or groups of symbols creating cipher text.

<!DOCTYPE html>
        <title>Substitution Cipher</title>
    <body bgcolor="green">
    <center><p style="font-size:35px"><strong>Substitution Cipher</p></strong><br><br>
        Place your text to Encrypt here:<br><br>
            <input type="text" id="data" name="data"><br><br>
        <p id="a"></p>
        <button onclick="myFunction()">Encrypt</button>


function myFunction() {
        var y = document.getElementById("data").value;

c=new Array();

(i=0; i<26; i++){ c[a.charAt(i)]=b.charAt(i); c[a.charAt(i).toUpperCase()]=b.charAt(i).toUpperCase();} a="";

a+=(b>='A' && b<='Z' || b>='a' && b<='z' ? c[b] : b);}
                document.getElementById("a").innerHTML = (a); }



More Free Code Examples:

Angular Click Counter


Popular posts from this blog

Multi-tap Keypad Text Entry