As part of the login process for my game I am storing the username / password in a file. To protect this and stop people using the password I have written some code to take the password, convert this to ASCII code, preform two mathematical operations and save this to a file.
Having undertaken some testing of my code I have found a couple of things:
1) Entering "Paul" produces the same result as "luaP"
2) Entering "Lisa" produces the same result as "Bart".
Paul = 180730
luaP = 180730
Lisa = 178093
Bart = 178093
Here is the code I have written. This is taken from my game but changed slightly to work as a standalone program.
[CreatePassword] PasswordCreate$ = "" length = 0 PasswordCreateText = 0 PasswordCreatePro$ = "" cls Input "Enter a password: "; PasswordCreate$ length = len(PasswordCreate$) for A = 1 to length PasswordCreatePro$ = mid$(PasswordCreate$, A) PasswordCreateText = PasswordCreateText + asc(PasswordCreatePro$) next A PasswordCreateText = PasswordCreateText * 293 PasswordCreateText = PasswordCreateText + 62944 Print ""; PasswordCreateText open "PassWordChecker_Temp.spf" for append as #UC print #UC, ""; PasswordCreate$; " = "; PasswordCreateText close #UC input "? "; RunChoice$ if RunChoice$ = "q" then gosub [EndOfTest] gosub [CreatePassword] [EndOfTest] notice "Program closed" end