Ask coding questions

← Back to all posts
How would i make a login so that only a specific pc can log in?
AzureScripts (149)

I want to add something to my login where it can detect if you're from the right pc. (will be part of the hash)

What data could i grab from the pc to add to the hash?

Answered by mwilki7 (262) [earned 5 cycles]
View Answer
mwilki7 (262)

mac address maybe
or come up with some rsa scheme

AzureScripts (149)

@mwilki7 Mac Address will do, but how do i get the mac address of a pc in python?

mwilki7 (262)

not absolutely certain if this works but try this

from uuid import getnode as get_mac
mac = get_mac()
print (hex(mac))
ash15khng (393)

@AzureScripts It may be a bit unsafe to hardcode your mac address of your PC on a repl, so you should use a env file.

AzureScripts (149)

@ash15khng I am not hardcoding my mac address
the address depends on who runs the script.
Different for everyone