joequery
10/19/2016 - 9:12 PM

sombra encrypt

sombra encrypt

<?php

function str_rot($s, $n = 13) {
    static $letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $n = (int)$n % 26;
    if (!$n) return $s;
    if ($n == 13) return str_rot13($s);
    for ($i = 0, $l = strlen($s); $i < $l; $i++) {
        $c = $s[$i];
        if ($c >= 'a' && $c <= 'z') {
            $s[$i] = $letters[(ord($c) - 71 + $n) % 26];
        } else if ($c >= 'A' && $c <= 'Z') {
            $s[$i] = $letters[(ord($c) - 39 + $n) % 26 + 26];
        }
    }
    return $s;
}

    function encrypt($password) {
        $passArray = str_split($password);
        $encrypted = array();
        foreach($passArray as $char) {
            $salt = count($encrypted);
            $char = base64_encode(dechex(ord(str_rot($char,($salt+3)))*3));
            if($salt % 2 == 0) $char = strrev($char);
            array_push($encrypted, $char);
        }
        $encrypted = implode(":", $encrypted);
        $encrypted = str_replace("=", "?", $encrypted);
        return $encrypted;
    }

$dudepw = "Xy@4+Bkuqd<53uJ";
$x = encrypt($dudepw);
echo $x;