May-07-2018, 04:22 PM
import base64 from Crypto.Cipher import AES message = open ('aestest.txt', 'r') results = open ('results.txt', 'w') bloo = message.read() decoded = base64.b64decode(bloo) x = 0 while x <= 99999999: y = "%08d" % (x) keyword = '546327364536211087236533' + y print 'Attempt number: ' + y decryptor = AES.new(keyword, AES.MODE_ECB) results.write(y + ' ' + decryptor.decrypt(decoded) + '\n') x +=1 print 'Check the results file!' results.close()Yes you are correct. I'm talking bytes not bits (sorry, very new to this still). so it's the last 8 bytes that are variable and only numeric.
I've posted my script above. The message to be decoded is base64 encoded to start with and it uses ECB mode for AES decryption as we know there's no IV used.
The output file size racks up quickly and that when i'm only in the 10,000 range of combinations. We're talking 200MB size.
killerrex - I'll look at your code in a minute and see if it works any better thanks.
Any other advice from anyone would be greatly appreciated.