SHOW:
|
|
- or go back to the newest paste.
| 1 | - | import sys |
| 1 | + | |
| 2 | - | import os |
| 2 | + | |
| 3 | - | import struct |
| 3 | + | |
| 4 | primes = [ # these are example values, replace them with the primes you get from msieve! | |
| 5 | 1, | |
| 6 | 2, | |
| 7 | - | primes = [ |
| 7 | + | |
| 8 | 4, | |
| 9 | 5, | |
| 10 | 6, | |
| 11 | 7, | |
| 12 | 8, | |
| 13 | 9, | |
| 14 | - | 53, |
| 14 | + | 10, |
| 15 | - | 223, |
| 15 | + | |
| 16 | - | 58741, |
| 16 | + | |
| 17 | - | 893213, |
| 17 | + | magic = '%PDF' # for a pdf file - change to the correct file magic if your sample.vvv is not a pdf |
| 18 | - | 28970877851, |
| 18 | + | |
| 19 | - | 117841794409, |
| 19 | + | |
| 20 | - | 25021050921059072897, |
| 20 | + | |
| 21 | - | 3657158624554318168403263120870530469, |
| 21 | + | with open("sample.vvv", "rb") as f:
|
| 22 | - | 5796541384453701088685497253162999309444909778482679302833, |
| 22 | + | header = f.read(414) |
| 23 | data = f.read(16) | |
| 24 | for i in xrange(1<<len(primes)): | |
| 25 | - | def padkey(str): |
| 25 | + | |
| 26 | - | while len(str) < 32: |
| 26 | + | |
| 27 | - | str = '0' + str |
| 27 | + | |
| 28 | - | return str |
| 28 | + | |
| 29 | if 1<<224 < x < 1<<256 and AES.new(binascii.unhexlify('%064x' % x), AES.MODE_CBC, iv).decrypt(data).startswith(magic):
| |
| 30 | print hex(x).upper() + " " + AES.new(binascii.unhexlify('%064x' % x), AES.MODE_CBC, iv).decrypt(data) |