JSFiddle - React, Tailwind, and code Playground

HTML

<h1>EasyBox KeyGen for Standart WPA2-Password</h1>
<p>Based on <a href="http://www.wotan.cc/?p=6">EasyBox Standard WPA Key</a> by Sebastian Petters.</p>
<p>Javascript version by snapwire_org</p>

<div>

<div id="input" style="width:300px;float:left;">
<label for="mac" style="display:block;">Enter MAC address:</label>
<input type="text" name="mac" title="Accepted formats:\n01:23:45:67:89:0A">
</div>

<div class="help" style="width:300px;float:left;">
<p>
<em>
<strong>Accepted formats:</strong><br>
01234567890A<br>
01-23-45-67-89-0A<br>
01:23:45:67:89:0A<br>
</em>
</p>
</div>

<div style="clear:both;"></div>

<div id="mac"></div>
<div id="c1"></div>
<div id="ssid"></div>
<div id="k1"></div>
<div id="k2"></div>
<div id="psk"></div>

</div>

JavaScript

var EasyBoxWPA = {};

EasyBoxWPA = function(mac) {
    var mac = mac
    
    if (this instanceof EasyBoxWPA) {
        if (this.isValidMac(mac)) {
            this.MAC = mac.replace(':','','g').replace('-','','g').toUpperCase();
            this.init();
        }
        else {
            throw 'InvalidMacException';
        }
    }
    else {
        return new EasyBoxWPA(mac);
    }
}

EasyBoxWPA.prototype = {
    MAC: null,
    C1: null,
    SSID: null,
    K1: null,
    K2: null,
    PSK: null,
    
    init: function() {
        var M = this.MAC;
        var C1 = (parseInt(M[8]+M[9]+M[10]+M[11], 16)).toString();
        this.C1 = C1;
        
        while (C1.length < 5) {
            C1 = '0'+C1;
        }
        this.C1 = C1;
        
        var S6 = C1[0];
        var S7 = C1[1];
        var S8 = C1[2];
        var S9 = C1[3];
        var S10 = C1[4];
        
        this.SSID = 'EasyBox-'+M[6]+M[7]+M[8]+M[9]+S6+S10;
        
        var M7 = M[6];
        var M8 = M[7];
        var M9 = M[8];
        var M10 = M[9];
        var M11 = M[10];
        var M12 = M[11];
        
        var K1 = (parseInt(S7,16)+parseInt(S8, 16)+parseInt(M11, 16)+parseInt(M12, 16)).toString(16);
        K1 = K1[K1.length-1];
        this.K1 = K1.toUpperCase();
        
        var K2 = (parseInt(M9,16)+parseInt(M10, 16)+parseInt(S9, 16)+parseInt(S10, 16)).toString(16);
        K2 = K2[K2.length-1];
        this.K2 = K2.toUpperCase();
        
        var X1 = (parseInt(K1,16) ^ parseInt(S10,16)).toString(16);
        var X2 = (parseInt(K1,16) ^ parseInt(S9,16)).toString(16);
        var X3 = (parseInt(K1,16) ^ parseInt(S8,16)).toString(16);
        var Y1 = (parseInt(K2,16) ^ parseInt(M10,16)).toString(16);
        var Y2 = (parseInt(K2,16) ^ parseInt(M11,16)).toString(16);
        var Y3 = (parseInt(K2,16) ^ parseInt(M12,16)).toString(16);
        var Z1 = (parseInt(M11,16) ^ parseInt(S10,16)).toString(16);
        var Z2 = (parseInt(M12,16) ^...