Open nithinmanoj10 opened 1 year ago
The password will be stored on the clipboard and will not be displayed on the screen of the user. After 10 seconds, the password will be cleared from the clipboard. This is done to prevent adversaries from performing clipboard based attacks and acquiring the password.
We need to install two modules to implement this functionality. They are: Pyperclip - it is a cross-platform Python module for copy and paste clipboard functions. It can be installed by typing in the following command.
pip install pyperclip
Threading - it helps in concurrent running of different parts of your program. We will be using the Timer method of this module to clear the clipboard. it can be installed using the following command.
pip install threading
import pyperclip
import threading
def clearClipboard():
pyperclip.copy(password)
t = threading.Timer(10.0, user.clearCB)
t.start()
Module for storing password on the clipboard for a particular amount of time