Skip to content

Instantly share code, notes, and snippets.

@FrankHassanabad
Created March 17, 2018 20:45
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 FrankHassanabad/9819b783516e4da2514c506e3ae951d9 to your computer and use it in GitHub Desktop.
Save FrankHassanabad/9819b783516e4da2514c506e3ae951d9 to your computer and use it in GitHub Desktop.
Crib phone example
for (let i = 0; i < encryptedPhoneNumbers.length - 1; ++i) {
const encryptedPhoneNum1 = encryptedPhoneNumbers[i];
const encryptedPhoneNum2 = encryptedPhoneNumbers[i + 1];
const xor = xorStrings(encryptedPhoneNum1, encryptedPhoneNum2);
const output = xorPlainTextWithCrib(xor, inputPhoneNum);
if (asciiMatch(output, '^[0-9]+\-[0-9]+\-[0-9]+$')) {
matches = matches.concat([[encryptedPhoneNum1, encryptedPhoneNum2]]);
}
}
@FrankHassanabad
Copy link
Author

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