#!/usr/bin/env python
#--*-- coding:UTF-8 --*--
import base64, string
from Crypto.Cipher import DES
THRESH = 0.9
keyFile = open("keys.txt")
keys = keyFile.readlines()
ciph=base64.decodestring("cG0okyHpOAADuNLv8bRpxpyZeU8kMA2kWV2zoV+YUos=")
for key in keys:
	obj=DES.new(key[0:8], DES.MODE_ECB)
	decodedStr=obj.decrypt(ciph)
	foundLetters = 0
	for eachChar in decodedStr:
		if eachChar.isalpha() or eachChar.isdigit() or eachChar.isspace():
			foundLetters = foundLetters+1
	if (float(foundLetters)/float(len(decodedStr)) > THRESH):
		print "DES(ciphertext,"+key[0:8]+")="+decodedStr

