Created
July 7, 2015 18:59
-
-
Save miawgogo/61ce47578b80bb794699 to your computer and use it in GitHub Desktop.
what i mannaged to do with a lack of sleep
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 csv,getpass | |
from Crypto.Cipher import AES | |
global ecsv | |
global uecsv | |
global passdict | |
global pwddb | |
global obj | |
pwddb=getpass("Enter Database Password:") | |
IV = 16 * '\x00' #this is a temporey IV until i can work out a good way to generate one | |
obj = AES.new(pwddb, AES.MODE_CBC, IV=IV) | |
def csvdecrypt(filecontent): | |
return obj.decrypt(filecontent) | |
def csv2dict(csvtext): | |
return csv.DictReader(csvtext) | |
def getpassword(filename): | |
ecsv=open(filename) | |
uecsv=csvdecrypt | |
passdict=csv2dict(uecsv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment