Friday, April 2, 2021

How to store/hash a password to a database but you also need the original password for access to a cisco network switch, using netmiko? I understand that there are RSA keys but how would you do it in python?

Hey guys, so i have been creating a flask application that can share screens through a cisco network switch. I have added a lot of user functionalities like creating their own account with a username and password. These passwords are stored and verified in a SQLite database by using generate_password_hash and check_password_hash from the Werkzeug module. However, I have also allowed the admin to change the password of the switch therefore it needs to be stored in a database. However, I don't mind hashing the password but I need the original password to get access to the switch to configure ports. I know then that there is no point of hashing the password LOL :')

Therefore, the main question would be "how to hash a password and obtain the original password because you need it for the application?"

I know there is no point of keeping the password floating around the code like a global variable or storing it as plain text in the database? Therefore, what do I do? Do I create my own encoding function?

By the way, I am also containerizing in a docker container. Please let me know also how to put it in a docker container on the cisco switch and make it available to users within the network's vicinity?

Thank you so much



No comments:

Post a Comment