+ 1

How to safely locate the login and password on a separate source?

It comes to the head just txt where the login and password is written, then at the entrance it is read (The project should be open source) The code looks like this: #.... #when the user sign up dat0 = input("Enter login: ") dat1 = input(" Enter password: ") PASS_LOG_WRITE=open('accounts.txt','a', encoding='utf-8-sig') PASS_LOG_WRITE.write(" Login: "+dat0+" \n") PASS_LOG_WRITE.write("Password: " +dat1+"\n") #..... #when user sign in dat2=input("Enter login: ") dat3=input(" Enter password: ") dat4 = open('accounts.txt','a', encoding='utf-8-sig') dat4.read() for dat2 in dat4: for dat3 in dat4: #...... else: #.......

9th Jan 2019, 4:14 PM
Imamura Munemitsu
Imamura Munemitsu - avatar
2 ответов
+ 2
Tibor Santa Is right. You should always use encryption and encapsulation to safe Login-Data. https://code.sololearn.com/cvv4UqkEtPDH/?ref=app
10th Jan 2019, 8:07 AM
Sebastian Keßler
Sebastian Keßler - avatar
+ 1
My gut feeling says it is very bad to store raw passwords of users in any public location. At least encrypt the password before you put it in file. Then, when the user tries to log is, use the same encryption when validating the password.
10th Jan 2019, 7:38 AM
Tibor Santa
Tibor Santa - avatar