""" This function takes an existing unencrypted password, and returns an encrypted version so that current test programs can update the dbConnectionDefs.py files, or anywhere else where a password was originally stored unencrypted. Let's assume that you have run the wizard, and have a directory with your generated app. One of the file is named 'dbConnectionDefs.py'; in it will be a line that reads: "password": "mypassword", with the appropriate password on the right. To convert this file to the new encrypted style, you need to run this utility as follows: python pwEncrypt.py mypassword This will print out an encrypted version of 'mypassword'; copy that, and paste it into your dbConnectionDefs.py file so that the password line reads: "password": "M96MD1BC5UE8TE1P77C99T68UE0VDB", In other words, make sure that the password stored in the file is the one returned by this utility when you pass it the original, unencrypted password. """ import sys from dabo.db.dConnectInfo import dConnectInfo if __name__ == "__main__": if len(sys.argv) < 2: print "Usage: python pwEncrypt.py " sys.exit() pw = sys.argv[1] ci = dConnectInfo() print """ Your encrypted password is: %s Copy/Paste the encrypted password to your connection definition, and remember that this encryption isn't really secure - it is like locking your car door: better than nothing, casual users will be kept out, but it cannot be your only security measure. """ % ci.encrypt(pw)