hi,
I'm here today to present a little work I did yesterday in a few hours, it is a method of storing login data encrypted
this system with a few small changes can help save secure data and prevent account theft.
just change the code to create a random key the first time that is saved in a configuration file, other than the login details it will serve to generate the encrypted data that it will vary from client to client.
Also I am attaching the new libraries necessary to add to the path "Lib" in client some of them have been modified by me to make them compatible with the functions applied, for my test I used an updated version of them.
### add it in intrologin.py ###
data stored is like this:
[Only registered and activated users can see links. Click Here To Register...]
i hope be useful :D
enjoy
d3m0n3
I'm here today to present a little work I did yesterday in a few hours, it is a method of storing login data encrypted
this system with a few small changes can help save secure data and prevent account theft.
just change the code to create a random key the first time that is saved in a configuration file, other than the login details it will serve to generate the encrypted data that it will vary from client to client.
Also I am attaching the new libraries necessary to add to the path "Lib" in client some of them have been modified by me to make them compatible with the functions applied, for my test I used an updated version of them.
### add it in intrologin.py ###
Code:
import base64
import string
def __encrypt(self, string):
try:
a = string
new_string = ''
for x in a:
new_string = new_string+str(int(ord(x)+127)*32)+' '
encrypt_string = base64.encodestring(new_string)
return encrypt_string
except:
print "LoginWindow.__encrypt - EncryptError"
return -1
def __decrypt(self, string):
try:
a = string
data = base64.decodestring(a)
new_string = ''
b = data.split()
for x in b:
new_string = new_string+chr((int(x)/32)-127)
return new_string
except:
print "LoginWindow.__decrypt - DecryptError"
return -1
def __SaveAccountInfo(self, user, passw):
try:
file=open("login.inf", "w+")
userid = self.__encrypt(user).strip('\n')
passwd = self.__encrypt(passw).strip('\n')
file.write("%s#%s" % (userid, passwd))
file.close()
except:
print "LoginWindow.__SaveAccountInfo - SaveError"
def __LoadAccountInfo(self):
try:
file=open("login.inf")
lines=file.readlines()
if len(lines)>0:
data=lines[0].replace('#', ' ')
tokens=data.split()
user=self.__decrypt(tokens[0].strip('\n'))
passw=self.__decrypt(tokens[1].strip('\n'))
return user, passw
except:
print "LoginWindow.__LoadAccountInfo - OpenError"
return -1, -1
def __OnClickSaveButton(self):
id = self.idEditLine.GetText()
pwd = self.pwdEditLine.GetText()
self.__SaveAccountInfo(id, pwd)
self.PopupNotifyMessage("Dati di Login Salvati!")
Code:
NzI2NCA1Njk2IDc1NTIgNTYwMCA3NTg0IDU2OTYg#Nzc3NiA3Mjk2IDc3NDQgNzc3NiA3Nzc2IDcyOTYgNzc0NCA3Nzc2IA==
i hope be useful :D
enjoy
d3m0n3