I'm having trouble with my encryption program | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

17th Aug 2017, 7:48 PM
X-1
X-1 - avatar
1 Answer
+ 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', ...].
18th Aug 2017, 4:07 AM
OrbitHv [Inactive]
OrbitHv [Inactive] - avatar