December 2018
Intermediate to advanced
226 pages
4h 57m
English
This is another common problem engineers face. There are times when we need to ask for password as input from the user. As the user types in the password, it is clearly visible on the screen, and view able by anyone watching the screen. Additionally, there are times when we need to save the credentials, but need to ensure they are not visible in the script as clear-text passwords (which is a cause of concern as we share the scripts among fellow engineers). In this example, we will see how to overcome this challenge.
The code to perform encryption and decryption on the given credentials is as follows:
import getpass import base64#ask for username .. will be displayed when typeduname=input("Enter your username :")#ask for ...Read now
Unlock full access