+ 1
I'm having trouble with my encryption program
I'm trying to create a program which turns a stored password into an array of hexadecimal numbers, and in order for the user to get "password accepted" the entered password must be also turned into an array and match with the array of the correct password. but currently I'm having a hard time looping, as the first time you get an incorrect attempt, even if you enter the right password, it still returns "password incorrect". https://code.sololearn.com/cPdTWD5N1Wkb/?ref=app
1 Antwort
+ 4
It is because the variable 'aArr' is not reset before entering new password.
When you first enter wrong password, for example, "X", variable 'aArr' becomes ['0x580x58']. Now, enter correct password "Hyejeong" is entered. Since 'aArr' is not reset, aArr becomes ['0x580x58', '0x480x48', '0x790x79', ...]. So this is different from ['0x480x48', '0x790x79', ...].