Skip to content

Instantly share code, notes, and snippets.

@saebekassebil
Created June 14, 2012 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saebekassebil/2931579 to your computer and use it in GitHub Desktop.
Save saebekassebil/2931579 to your computer and use it in GitHub Desktop.
DanID string decryption
function decryptDanIDString(string) {
var i = 42, j = string.length - 4, k, decoded = '';
for(k = 0; k < j; k++) {
var m = string[k + 4];
var mcode = m.charCodeAt(0);
if(mcode > 31 && mcode < 127) {
var tmpcode = (i + string[k].charCodeAt(0) + mcode) % 95 + 32;
i = tmpcode;
decoded += String.fromCharCode(tmpcode);
} else {
decoded += m;
}
}
return decoded;
}
@saebekassebil
Copy link
Author

Gist Family:
#2931589 - All DanID/NemID string constants JSON file
#2931579 - DanID/NemID javascript string-deobfuscator
#2931595 - DanID/NemID constant lookup JSON file

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