Last day when I was busy learning the SAS and R in the workshop provided by MSBA program in USC, I thought a lot about my next python program. All the program I wrote are driven by my interest in python, so until I found something interesting again, I would hardly write something notable.
I came across a post on http://www.williamlong.info/archives/3224.html, which inspired this short program. Unfortunately it was written in Chinese and the main idea is about the security of your password. To sum up, there are a lot of encryption rules and most of them are related to MD5(Message-Digest Algorithm), which generates hash value. However, due to the fast-growing technology, MD5-generated code could also be hacked using super computers. Many others would recommend a newer algorithm but in my opinion the hacking is a matter of time.
Therefore, what I am going to do is to enhance the difficulty of password hacking. I am going to give the password a random shuffle and a for loop to increase the complexity and time for breaking. Here is my simple idea:
from random import shuffle
def MD5_parser(pwd_1, number):
new_md5 = hashlib.md5()
count = 0
full_md5 = ''
while count < number:
for i in pwd_1:
# print new_md5.hexdigest
full_md5 += str(new_md5.hexdigest())
pwd_1 = full_md5
full_md5 = ''
count += 1
b = 
for i in pwd:
pwd_1 = ''.join(b)
print 'Your password after shuffle is ' + pwd_1 + '\n'
# raw_input returns a str
number = int(raw_input('How many times do you want your password to be envrypted: '))
pwd = raw_input('Enter your password here: ')
pwd_1 = shuffle_password(pwd)
final_MD5 = MD5_parser(pwd_1, number)
if __name__ == '__main__':
During this example I found out that Sublime Text 3 surprisingly did not support “raw_input” function because it could not pop out a window for users to input the strings. It makes ST3 so annoying that I have to have terminal active all the time.
Overall, I don’t think there’s any kind of password that is unbreakable so security should be well considered every time you store it at some place. What’s more, we need to increase the time and cost for hacking, and also lower the value of breaking our password. Protect yourself on the Internet!