I am working on a small program that requires the user to insert a USB Flash Drive (pre configured) to login to the system. The way it works right now is you log in to the windows OS, like usual. Then the script checks for the USB key, and if found, closes. But, if the key isn’t found, the a dialog appears for the user to input a password. They have a certain amount of time they specify during installation.
Now, the problem with this is, the user can just launch the task manager and kill the process, thus rendering the script useless. Is there a better way to do this? How would I just disable the task manager if the USB key isn’t present?
The software is written entirely in Python.
From your comments, you’re logging the user into a Windows session. You won’t be able to secure the system with the scheme you’ve set up – you’ve discovered the first of what will be many easily-exploited vulnerabilities. Look into credential providers (and GINA for editions of Windows older than Vista) – they’re really your only sane path forward.
It’s unlikely you’ll be able to develop that with Python.