خرید بک لینک

I created minor encrypt method to convert a small string based on distance between characters, but can't for the life of me figure out how to reverse it without knowing the distance between each character from the initial conversion. See image for example how it works imgur.com/Ine4sBo.png

I've already made the encrypt method here (Javascript):

var all = ("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.#-?").split('');
    var position;
    //var oKey = "P";



    function encrypt() // Encrypt Fixed
    {

        var sEncode = ("HI-MOM").split('');
        var oKey = "P";

        for (var i = 0; i < sEncode.length; i++) {
            if (all.indexOf(oKey) < all.indexOf(sEncode[i])) {                    
                position = all.indexOf(sEncode[i]) - all.indexOf(oKey);
                output.value += "oKey: " + oKey + " distance to sEncode[" + i + "]: " + sEncode[i] + " Count: " + position + " Final Char: " + all[position-1] + "n";
                oKey = sEncode[i];
            }
            else {                    
                position = all.length - all.indexOf(oKey) + all.indexOf(sEncode[i]);
                output.value += "oKey: " + oKey + " distance to sEncode[" + i + "]: " + sEncode[i] + " Count: " + position + " Final Char: " + all[position-1] + "n";
                oKey = sEncode[i];
            }


        }
    }

However, it's the decrypt() method that's killing me.

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: شنبه 26 تير 1395 ساعت: 7:31

صفحه بندی