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')); |
This comment has been minimized.
This comment has been minimized.
Mantic
commented
Sep 17, 2014
Second that: Thanks! |
This comment has been minimized.
This comment has been minimized.
chrisharrisonkiwi
commented
Oct 6, 2014
Lifesaver! Thanks :) |
This comment has been minimized.
This comment has been minimized.
d9kgit
commented
Nov 26, 2014
love! thx! |
This comment has been minimized.
This comment has been minimized.
elgarfo
commented
May 3, 2015
thank you. saved me from digging into heidi's source |
This comment has been minimized.
This comment has been minimized.
rguimaraens
commented
Jul 17, 2015
Thanks, bro! Saved my day! |
This comment has been minimized.
This comment has been minimized.
ricklamers
commented
Jul 26, 2015
This is brilliant. Just what I needed. |
This comment has been minimized.
This comment has been minimized.
ricklamers
commented
Jul 26, 2015
P.S. Registery location: Computer\HKEY_CURRENT_USER\SOFTWARE\HeidiSQL\Servers |
This comment has been minimized.
This comment has been minimized.
hao365
commented
Oct 10, 2015
Thank you! |
This comment has been minimized.
This comment has been minimized.
IljaN
commented
Nov 16, 2015
Thanks |
This comment has been minimized.
This comment has been minimized.
dborsatto
commented
Jan 14, 2016
Thanks, I fired up a console in Firefox and retrieved my password! |
This comment has been minimized.
This comment has been minimized.
sjungwirth
commented
Mar 23, 2016
thanks! |
This comment has been minimized.
This comment has been minimized.
diegoarigony
commented
Mar 29, 2016
Awesome, thanks! |
This comment has been minimized.
This comment has been minimized.
deenfirdoush
commented
Mar 31, 2016
coool. saved my day |
This comment has been minimized.
This comment has been minimized.
trevorbicewebdesign
commented
Apr 11, 2016
I wrote a PHP version if you want to do this server side! |
This comment has been minimized.
This comment has been minimized.
yoch
commented
Sep 22, 2016
Thanks ! Here a python version : def decode(hx):
shift = int(hx[-1])
l = [int(hx[i:i+2], 16) for i in range(0, len(hx), 2)]
return ''.join(chr(v - shift) for v in l) |
This comment has been minimized.
This comment has been minimized.
wendyliga
commented
Mar 21, 2017
•
i try to make it more easy thanks for Trevor Bice for php code |
This comment has been minimized.
This comment has been minimized.
pmarcus93
commented
Apr 6, 2017
It's never late to say thank you, right? :) |
This comment has been minimized.
This comment has been minimized.
Elektrik1
commented
May 20, 2017
https://github.com/Elektrik1/HeidiSQLDecode |
This comment has been minimized.
This comment has been minimized.
taodailOryx
commented
Feb 8, 2018
Good god, I'm an idiot. Thanks so much for this. |
This comment has been minimized.
This comment has been minimized.
nstr10
commented
Mar 6, 2018
•
Thanks, @jpatters! Here, have a PowerShell version with bonus registry lookup: function Get-HeidiCreds {
$profile = "user@server"
$password = (Get-Item -Path registry::HKEY_CURRENT_USER\SOFTWARE\HeidiSQL\Servers\).OpenSubKey($profile.toString()).GetValue("Password").toString()
$username = (Get-Item -Path registry::HKEY_CURRENT_USER\SOFTWARE\HeidiSQL\Servers\).OpenSubKey($profile.toString()).GetValue("User").toString()
$shift = [Convert]::ToInt64($password.substring($password.toString().length-1,1))
$password = $password.substring(0,$password.toString().length-1)
$str = ""
for ($i=0; $i -lt $password.length; $i += 2) {
$val = [Convert]::ToInt64($password.substring($i,2), 16)
$val = '{0:x1}' -f ($val - $shift)
$val = $val | ForEach-Object {[Convert]::ToInt32($_,16)} | ForEach-Object {[Convert]::ToChar($_)}
$str += $val
}
$password = $str
return $username, $password
} Note: You can use the same method to get credentials for SSH tunnel if configured, just choose those registry keys instead. |
This comment has been minimized.
This comment has been minimized.
vuhanguyen
commented
May 16, 2018
Thank you so much, it saved my day |
This comment has been minimized.
This comment has been minimized.
joeyhub
commented
Aug 23, 2018
•
PHP Decode:
Note that PHP's chr wraps negative numbers properly. Not all languages will do this. You may need If you're encoding your own password (generating conf)...
There's no point to bother shifting it. Shifting and hex encoding is so weak it might as well be plain text. |
This comment has been minimized.
This comment has been minimized.
joeyhub
commented
Aug 23, 2018
@wendyliga Do you have everyone's password now :D? |
This comment has been minimized.
This comment has been minimized.
Gicheha
commented
Oct 10, 2018
you are a lifesaver |
This comment has been minimized.
This comment has been minimized.
DRSDavidSoft
commented
Dec 25, 2018
Thank you! |
This comment has been minimized.
This comment has been minimized.
yanikore
commented
Jan 2, 2019
Thanks |
This comment has been minimized.
This comment has been minimized.
cpereiraweb
commented
Jan 31, 2019
THANKS A LOT!!!! |
This comment has been minimized.
MrTypos commentedAug 18, 2014
I was in a hurry to get a password that I should have properly stored and this handy little snippet allowed me to do so without taking the time to write something similar myself.
I know have the time to come back and say "Thanks!".