[英]How would I securely prevent a user from getting a string in my script?
If I was to give a python script to someone to run, they would have to run it with an API key to allow access to the server.如果我将一个 python 脚本提供给某人运行,他们必须使用 API 密钥运行它以允许访问服务器。 Is there any way I can prevent them from seeing the key but still be able to use it.有什么办法可以阻止他们看到密钥但仍然可以使用它。
If you really need to protect this key, then you need to treat it as a password.如果您确实需要保护此密钥,则需要将其视为密码。
There are various ways of doing this:有多种方法可以做到这一点:
Securely storing passwords for use in python script has 3 answers: 安全存储在 python 脚本中使用的密码有 3 个答案:
bcrypt
使用bcrypt
pbkdf2
使用pbkdf2
I need to securely store a username and password in Python, what are my options? 我需要在 Python 中安全地存储用户名和密码,我有哪些选择? has 7 answers:有 7 个答案:
keyring
使用keyring
cryptography
使用cryptography
pbkdf2
使用pbkdf2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.