Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

The CMs logins

T342 edited this page Dec 9, 2024 · 5 revisions

Caution

This page is WIP or not fully finished.

Introduction to the CMs logins

Hello again fellow VAIIYA Trustees and THE FINALS contestants! Welcome to The CMs Logins page! here, you will see what password system I use, how I got it to work, and see the code inside!

Into the CMs logins verse!

Important

First up! Reminders! That this page is an extension of the commands page, due to this being prob very long!

Second up! the examples in this entire page will share the same skeleton code, with minor startup differences. (that I will also show too <3)

The password system!

Note

The password hashing library I used was Bcrypt

Alright! lettuce ( ̄y▽, ̄)╭ start!

as usual, lettuce start with a mermaid diagram of the functions! then explain everything else in DETAIL! (。_。)

flowchart TD 

CM_login_command_sent --> open_password_prompt

open_password_prompt --> userpassword_input
userpassword_input --> bcrypt_encrypt_userpassword
bcrypt_encrypt_userpassword --> userpassword_result
userpassword_result --> bcrypt_hashcheck


real_passwordhash --> bcrypt_hashcheck

bcrypt_hashcheck --> does_hash_match? 


does_hash_match? --> user_passwordhash_MATCHES
does_hash_match? --> user_passwordhash_DOES_NOT_MATCH


user_passwordhash_MATCHES --> allow_next_code_run

user_passwordhash_DOES_NOT_MATCH --> return_to_main
Loading

Important

Do note, that I do not exactly know how Bcrypt works, but this is what the password system is doing in VAIIYA Terminal

Alright! lets get that sweet sweet code in here so we can start detailing this! (^///^)

#the website for reference to the password system is https://www.geeksforgeeks.org/npm-bcrypt/   
#walkerpasswrd1
walkerhash = b'$2b$12$M7LXCClyfsnN9SjibtnEmuLEOlR68H2ovjCBA0zcAIBs2RHBzOnFy'


#walker login here
def walker_login():
    #when exiting the prompt with the `<cancel>`, the program will force-quit for some reason. 

    #password prompt; 
    userpassword = text = input_dialog(
    title='Walker password input',
    text='walker password:',
    password=True,
    ).run()
    #encodes the given password for compare
    userpassword = userpassword.encode('utf-8')

    #compare password hashes, if identical then "result" == True, then it will move onto walker_entered
    result = bcrypt.checkpw(userpassword, walkerhash)
    if result:
          walker_entered()

I am using walkers login for the demo ☜(゚ヮ゚☜)

alright! lettuce ( ̄y▽, ̄)╭ get started! (again 🤣) first thing that happens when you run the login command, you get a nice, beautiful, sky blue, screen. (⊙_⊙)? With a beautiful little text box! how cute!

that text box is the userpassword listener! it will wait for a password to be entered, then it will change its value to that inputted password! how nice!

then after, the userpassword element's string value will get sent off to the userpassword.encode('utf-8') element! Bcrypt will then encrypt the password, and somehow (I have no idea how this works 🤣) compare the userpassword hash, with the walkerhash string. If bcrypt agrees that this is the correct inputted password, it will set the result value to True, and you will be on your way to whatever you put behind that password wall!

Caution

This wiki contains a large amount of spoilers for VAIIYA Terminal! YOU WILL BE WARNED BEFORE SPOILERS SHOW UP!

Warning

This wiki is currently WORK IN PROGRESS! Thank you for understanding.

Clone this wiki locally