import keyring keyring.set_password('test_db','louis','secret123') keyring.get_password('test_db','louis') 'secret123'
1 Answer
What you need is keyring.cryptfile. With this way, a cryptfile_pass.cfg file will created with hashed passwords (argon2 hash).
You can use it like this:
from keyrings.cryptfile.cryptfile import CryptFileKeyring
kr = CryptFileKeyring()
kr.set_password("service", "username", "my_secret_key_code")
>>>Type your password: MyPass_word
kr.get_password("service", "username")
>>>Please enter password for encrypted keyring:
if you press:'my_secret_key_code' you will get: MyPass_word
See more here.