Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@cpereiraweb
Copy link

cpereiraweb commented Jan 31, 2019

THANKS A LOT!!!!

@meysam-mo
Copy link

meysam-mo commented Feb 24, 2019

Wow !! tnx

@rudikom
Copy link

rudikom commented Nov 5, 2019

thank you,,

@Godtooro
Copy link

Godtooro commented Mar 31, 2020

Hi!
Awesome! Thank u! We owe you one.
All the best.

@IsraelIglesiasBIT
Copy link

IsraelIglesiasBIT commented Apr 3, 2020

And how encode a password?

I need to generate a settings file for Heidi with php for my all databases connections?

@jordihernandez
Copy link

jordihernandez commented Jun 30, 2020

Thank you!

@Pes8
Copy link

Pes8 commented Aug 2, 2021

Thank You all :)

@erickcomp
Copy link

erickcomp commented Apr 25, 2022

Thank you!

@cpc-zdunham
Copy link

cpc-zdunham commented Nov 21, 2022

@IsraelIglesiasBIT not sure if you still need it considering this comment was two years ago, but here's a PowerShell solution for encoding passwords for Heidi:

    $heidiPass = "password"
    $obfuscatedPass = ''
    $shift = Get-Random -Minimum 1 -Maximum 10

    for ($i = 0; $i -lt $heidiPass.Length; $i++) {
        $char = [int][char]$heidiPass[$i] + $shift
        $hex = $char.ToString("X")
        $obfuscatedPass += $hex
    }
    $obfuscatedPass += $shift.ToString()

@elgarfo
Copy link

elgarfo commented Nov 23, 2022

a javascript snippet to encode a password:

function heidiCrypt(plain) {
  crypted = ""
  shift = Math.floor(Math.random() * 10)
  for(i = 0; i < plain.length; i++) {
    crypted += (plain.charCodeAt(i) + shift).toString(16).toUpperCase();
  }
  return crypted + shift;
}

console.log(heidiCrypt("password"));

@IsraelIglesiasBIT
Copy link

IsraelIglesiasBIT commented Nov 23, 2022

@IsraelIglesiasBIT not sure if you still need it considering this comment was two years ago, but here's a PowerShell solution for encoding passwords for Heidi:

    $heidiPass = "password"
    $obfuscatedPass = ''
    $shift = Get-Random -Minimum 1 -Maximum 10

    for ($i = 0; $i -lt $heidiPass.Length; $i++) {
        $char = [int][char]$heidiPass[$i] + $shift
        $hex = $char.ToString("X")
        $obfuscatedPass += $hex
    }
    $obfuscatedPass += $shift.ToString()

😄 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment