Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
decode HeidiSQL password in php
<?php
// ported from http://sourceforge.net/p/heidisql/code/HEAD/tree/trunk/source/helpers.pas#l462
function heidisql_decrypt($str){
$j = $salt = $nr = 0;
$result = '';
if ($str == '') {
return ;
}
$j = 0;
$salt = intval($str[strlen($str)-1]);
while($j < strlen($str)-1){
$nr = hexdec($str[$j] . $str[$j+1]) - $salt;
if ($nr < 0) {
$nr += 255;
}
$result .= chr($nr);
$j += 2;
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.