-
-
Save balidani/596cd8cd11da0b955ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
iv1 = [0x0ED, 0x0DB, 0x0E1, 0x104, 0x0F7, 0x0F7, 0x0E9, 0x0EF, 0x0E3, 0x0D6] | |
iv2 = [0x0AC, 0x094, 0x0A4, 0x096, 0x094, 0x091, 0x093, 0x09D, 0x0A3, 0x0A5, 0x0AE, 0x09F, 0x0AE, 0x08E, 0x0BE, 0x098, 0x0B3, 0x094, 0x0A8, 0x090, 0x0B3, 0x090, 0x0AD, 0x095, 0x08F, 0x0A2, 0x08A, 0x08D] | |
iv3 = [0x0A0, 0x086, 0x0A2, 0x0A2, 0x093, 0x087, 0x09E, 0x0AD, 0x09A, 0x09E, 0x0A8, 0x0B5, 0x094, 0x0A8, 0x0B2, 0x099, 0x0A0, 0x0A7, 0x0A3, 0x0A0, 0x095, 0x09D, 0x0B3, 0x082, 0x09C, 0x09D, 0x080] | |
for c in map(ord, string.printable): | |
p = [c] + [0] * 30 | |
fail = False | |
for i in range(10): | |
p[i * 3 + 2] = iv2[i * 3 + 0] - p[i * 3] | |
p[i * 3 + 1] = iv1[i] - p[i * 3] - p[i * 3 + 2] | |
if i < 9: | |
p[i * 3 + 3] = iv2[i * 3 + 1] - p[i * 3 + 1] | |
check = iv3[i * 3 + 0] - p[i * 3] | |
if p[i * 3 + 3] != check: | |
fail = True | |
if not fail: | |
print ''.join(map(chr, p)) | |
""" | |
MA_SECONDO_VOI_E_STATO_ANTANI? | |
--> ANTANI | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment