Forum Archive

Keychain issues

scj643

The keychain module seems to be missing functionality. No way to set a master password, and deleting it doesn't requrie confirmation.

dgelessus

My iPhone brick running Pythonista 1.5 supports keychain.set_master_password. For mysterious reasons, this is not included in Pythonista 2. @omz

scj643

Well this is a serious issue since I need a secure way to store passwords

Webmaster4o

@scj643 I'm sure @omz will put it back in.

scj643

Would be useful when working with APIs on device

dgelessus

You can still set passwords for individual accounts using set_password. That can be done programmatically too, so you can ask the user for a password once and then secure multiple accounts with it. Of course this is not the same as a master password, but it should at least work.

omz

You could also encrypt the passwords yourself, using PyCrypto...

scj643

The keychain also survives an app deletion btw

Phuket2

Now I understand why I was having a problem to come up with a reasonable class using KeyChain. There was a bit missing 😱
But when this is resolved, it would be great if someone could make a wrapper/extended class or lib that simplifies using the keychain for Dropbox app folder/apps/, Github etc...also incorporating Touch ID(https://forum.omz-software.com/topic/2156/share-code-touch-id-authentication-in-pythonista)
So some standard templates for some known popular services and a generic template for adhoc passwords/Secrects

scj643

Also it could be used to store data that needs to survive an app reinstall potentially.

Phuket2

@scj643 , yes. Backup/restore methods to whatever service. Or at least some popular services.