JSFiddle - React, Tailwind, and code Playground

by dsgnr

HTML

<form>
<label>Enter your password here:</label>
    <input type="password" id="enc-passphrase"/>
    <input type="button" value="Generate" id="encrypt" />
    <div class="clear h10"></div>
    <div id="result">
        <label>Copy this:</label>
        <div class="clear h5"></div>
        <textarea id="enc-copy-box" rows="20" cols="50"></textarea>
        <div class="clear h10"></div>
        
        <label>Check:</label>
        <div class="clear h5"></div>
        <label>Enter passphrase:</label>
        <input type="password" id="dec-passphrase"/>
        <div class="clear h5"></div>
        <textarea id="dec-copy-box" rows="20" cols="50"></textarea>
        <div class="clear h5"></div>
        <input type="button" value="Validate" id="decrypt" />        
        <div class="clear h5"></div>
        <p class="result"></p>
    </div>
</form>

CSS

.clear{
    clear:both;
}
.h10{
    height:10px;
}
.h5{
    height: 5px;
}
p.result{
    color:green;
}

JavaScript

function BigInteger(e,t,n){e!=null&&("number"==typeof e?this.fromNumber(e,t,n):t==null&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function nbi(){return new BigInteger(null)}function am1(e,t,n,r,i,s){for(;--s>=0;){var o=t*this[e++]+n[r]+i,i=Math.floor(o/67108864);n[r++]=o&67108863}return i}function am2(e,t,n,r,i,s){var o=t&32767;for(t>>=15;--s>=0;){var u=this[e]&32767,a=this[e++]>>15,f=t*u+a*o,u=o*u+((f&32767)<<15)+n[r]+(i&1073741823),i=(u>>>30)+(f>>>15)+t*a+(i>>>30);n[r++]=u&1073741823}return i}function am3(e,t,n,r,i,s){var o=t&16383;for(t>>=14;--s>=0;){var u=this[e]&16383,a=this[e++]>>14,f=t*u+a*o,u=o*u+((f&16383)<<14)+n[r]+i,i=(u>>28)+(f>>14)+t*a;n[r++]=u&268435455}return i}function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var n=BI_RC[e.charCodeAt(t)];return n==null?-1:n}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t;e.s=this.s}function bnpFromInt(e){this.t=1;this.s=e<0?-1:0;e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0}function nbv(e){var t=nbi();t.fromInt(e);return t}function bnpFromString(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.s=this.t=0;for(var r=e.length,i=!1,s=0;--r>=0;){var o=n==8?e[r]&255:intAt(e,r);o<0?e.charAt(r)=="-"&&(i=!0):(i=!1,s==0?this[this.t++]=o:s+n>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,s+=n,s>=this.DB&&(s-=this.DB))}if(n==8&&(e[0]&128)!=0)this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s);this.clamp();i&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function bnToString(e){if(this.s<0)return"-"+this.negate().toString(e);if(e==16)e=4;else if(e==8)e=3;else if(e==2)e=1;else if(e==32)e=5;else if(e==64)e=6;else if(e==4)e=2;else return this.toRadix(e);var...