Password system ( showcase )

Took me abit of googling to find out a keys.BACKSPACE exist but here we go:

from getkey import getkey,keys
from replit import clear
#Fake password
list_1 = []
options = ['PassWord: ','Show Password','Hide password']
#Real password
list_2 = []
list_3 = list_1
def Sign_In(menu):
  global list_1,list_2,cnt,key,list_3,opt,Hello,opt_2,temp_var
  opt_2 = ''
  Hello = False
  opt = ''
  selection  = 0
  cnt = 0
  key = ''
  while True:
    if key == keys.ENTER:
      if opt == 'PassWord: ':
    print('           Sign In!')
    for i in range(len(menu)):
      opt = menu[i]
      if i == selection:
        if opt == 'PassWord: ':
          opt_2 = "".join(list_2)
          if Hello == True:
            print(f'> {opt}{opt_2}')
            opt_2 = ''.join(list_1)
            print(f'> {opt}{opt_2}')
          print(f'> {opt}')

        if opt == 'PassWord: ':
          if Hello == True:
            print(f'  {opt}{"".join(list_2)}')
            print(f'  {opt}{"".join(list_1)}')
          print(f'  {opt}')

    key = getkey()
    string = key

    if key == keys.UP:

      selection = (selection - 1) % len(menu)
      if selection == -1:
          selection = (selection + len(menu)+1) % len(menu)
    elif key==keys.DOWN:

      selection = (selection + 1) % len(menu)
      if selection > len(menu):
          selection = (selection - len(menu)-1) % len(menu)
    if key == keys.UP or key == keys.DOWN:
      if key == keys.ENTER and selection == 0:
        print('Signed in!')
      elif key == keys.ENTER and selection == 1:
        list_3 = list_2
        Hello = True
      elif key == keys.ENTER and selection == 2:
        list_3 = list_1
        Hello = False
      if selection == 0:
        if key == keys.BACKSPACE:
          temp_var = list_1.pop(-1)
          temp_var = list_2.pop(-1)

I would not say its too hard to make it lol

1 Like

Wow, this looks cool. Maybe I’ll use this for one of my repls. (I’ll credit you if I do)

Wait, password is stored in list_2? list_1? It wouldn’t take much reverse-engineering, so try adding in code that calculates the meaning of life. It can solve philosophy and slightly obfusticate your code even more!

1 Like

Now obviously this is just a sample of what it would prolly look like you can obviously not follow me bcs yes and this password system you need a database or a Json db to store all the info so its just pretty much a template so don’t try to use this if you are not planning to store the info in a db.

Could you please send a link to the Repl?

(Why do I sound like I’m trying to help someone, lol.)

1 Like yes pls help me solve this issue I am having a QWERTY_QWERTY 6969 ERROR so please help me solve it.

I don’t understand a line of code you write tbh (Idk I just really care about code beauty) so d’you mind explaining it?

Then use a code beautifier make it look beautiful.

1 Like

Yeah I would but that’s not how code beautifiers work. They don’t change your code. Just make it prettier.

What I meant was: Why are there three lists? What is “Hello”??? and why do you always use globals? ;-;