Skip to content

Instantly share code, notes, and snippets.

/nsa.php Secret

Created October 29, 2016 16:00
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/7d19a35c54e7dac40fa1a470df4a209a to your computer and use it in GitHub Desktop.
break the nsa encryption
* Encrypts a given plaintext using the supplied key.
* @param key a numeric key with a value greater than 255
* @param plainText a string containing the plaintext you want to encrypt
* @return number a unique number for this given key and plaintext
function nsaEncrypt($key, $plainText)
$result = 0;
for ($character = 0; $character < strlen($plainText); $character++)
$result = bcadd($result, ord($plainText[$character]));
$result = bcmul($result, $key);
return $result;
Here’s the ciphertext you need to deal with. It represents the encrypted version of a md5 hash. Decrypt it and then crack the hash to get the solution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment