javascript

Email, phone, text obfuscation javascript

Insert this code 
<script>
(function(w, undefined){
    var OBF = {
        offset: -5, //change this
        range: 11,  //change this
        process: function( s, d){
            var out = '',i;
            for(i=0;i<s.length;i++){
                out += String.fromCharCode(
                    s.charCodeAt(i)
                        + d*this.offset 
                        + d*(i%this.range)
                );
            };
            return out;
        }
        ,encode: function(s){ return this.process(s, 2); } 
        ,decode: function(s){ return this.process(s,-2); }
    };
    w.OBF = OBF;
})(window);
function enc(str, encoding = 'utf-8') { return btoa(str); }
function dec(str, encoding = 'utf-8') { return atob(str); }
var test = "al1tcA=="; //change variable and obfuscated text
</script>

How include in HTML
<text id="test"></text>
<script>document.getElementById("test").innerHTML = OBF.decode(dec((p)));</script>


How to encode text
console.log (enc(OBF.encode( 'your text' )));

Decode obfuscated text
console.log ('obf to raw = ' + OBF.decode(dec('al1tcA==')) );

admin

Share
Published by
admin

Recent Posts

How to back up and restore the ESXi host configuration

Original https://kb.vmware.com/s/article/2042141 Backing up ESXi host configuration data To synchronize the configuration changed with persistent…

4 месяца ago

vCenter Converter Standalone download

vCenter Converter Standalone 6.6.0 download (далее…)

5 месяцев ago

VMware remote console (VMRC) 12 download

VMware remote console (VMRC) 12.0.5 download Last version: VMware Remote Console 12.0.5  28 NOV 2023…

12 месяцев ago

Mysql calculate row size for all tables

SELECT col_sizes.TABLE_SCHEMA, col_sizes.TABLE_NAME, SUM(col_sizes.col_size) AS EST_MAX_ROW_SIZE FROM ( SELECT cols.TABLE_SCHEMA, cols.TABLE_NAME, cols.COLUMN_NAME, CASE cols.DATA_TYPE WHEN…

1 год ago

Mysql change date format in database

UPDATE DB SET column = DATE(STR_TO_DATE(column, '%Y-%d-%m')) WHERE DATE(STR_TO_DATE(column, '%d-%m-%Y')) <> '0000-00-00'

1 год ago

esxi debian lvm extend partition

echo 1 > /sys/class/block/sda/device/rescan #maybe run under root> sudo fdisk /dev/sda2 > d > 2…

1 год ago