2014-02-07, 23:40
A password storage module that stores passwords to the platforms encrypted keyring if available or an internal encrypted keyring.
This perhaps will eventually be most useful to other addon developers, but currently only resides on my repository while I'm testing it.
I would appreciate any users who would be willing to test it (especially OSX, iOS and Raspberry Pi users) and post the results here. It shows up under 'Programs' and running it will display some info about the keyring and a button to display errors and a button for options if the internal keyring is used. The platform you are actually using, the reported plaform, keyring name and any errors would be useful information.
It is currently only used by the latest versions of my Facebook-Media and Forum Browser addons which are also on my repository.
In case you missed it, here's the link to my repository: http://ruuks-repo.googlecode.com/files/r...-1.0.0.zip.
A note to addon developers:
While not useful to anyone else now, when I've done enough testing and gotten some feedback I plan to add this to the Official repository.
Here's some basic usage info:
The default behavior of retrieve() is to ask for the password if none is stored. This can be overridden with ask_on_fail=False:
The ask prompt defaults to "Enter the password for <ADDON_NAME>:" but can be overridden (and generally should) with ask_msg:
Everything else is handled by the addon. All password storage either uses the platform's encrypted storage or the internal keyring which is also encrypted.
The internal keyring requires unlocking by a passphrase at the first use in an XBMC session. The user can choose to bypass this in the Password Storage options by storing the key to disk. This actually stores a random key to disk so that a users password is never stored unencrypted. While this is still not very secure, the option is there for users who really don't want to be bothered by a request for a password.
There are also some extra functions for encrypting and decrypting data:
To delete a stored password:
To delete an encrypted data key:
Please feel free to make suggestions or ask questions
Platforms tested so far:
This perhaps will eventually be most useful to other addon developers, but currently only resides on my repository while I'm testing it.
I would appreciate any users who would be willing to test it (especially OSX, iOS and Raspberry Pi users) and post the results here. It shows up under 'Programs' and running it will display some info about the keyring and a button to display errors and a button for options if the internal keyring is used. The platform you are actually using, the reported plaform, keyring name and any errors would be useful information.
It is currently only used by the latest versions of my Facebook-Media and Forum Browser addons which are also on my repository.
In case you missed it, here's the link to my repository: http://ruuks-repo.googlecode.com/files/r...-1.0.0.zip.
A note to addon developers:
While not useful to anyone else now, when I've done enough testing and gotten some feedback I plan to add this to the Official repository.
Here's some basic usage info:
Code:
import passwordStorage
username = 'ruuk'
password = 'password'
passwordStorage.store(username,password)
retrieved_password = passwordStorage.retrieve(username)
The default behavior of retrieve() is to ask for the password if none is stored. This can be overridden with ask_on_fail=False:
Code:
retrieved_password = passwordStorage.retrieve(username,ask_on_fail=False)
The ask prompt defaults to "Enter the password for <ADDON_NAME>:" but can be overridden (and generally should) with ask_msg:
Code:
msg = "Enter the password for %s:" % username
retrieved_password = passwordStorage.retrieve(username,ask_msg=msg)
Everything else is handled by the addon. All password storage either uses the platform's encrypted storage or the internal keyring which is also encrypted.
The internal keyring requires unlocking by a passphrase at the first use in an XBMC session. The user can choose to bypass this in the Password Storage options by storing the key to disk. This actually stores a random key to disk so that a users password is never stored unencrypted. While this is still not very secure, the option is there for users who really don't want to be bothered by a request for a password.
There are also some extra functions for encrypting and decrypting data:
Code:
identifier = 'identifying label'
data = 'some test data'
encrypted_data = passwordStorage.encrypt(identifier,data)
decrypted_data = passwordStorage.decrypt(identifier,encrypted_data)
To delete a stored password:
Code:
passwordStorage.delete(username)
To delete an encrypted data key:
Code:
passwordStorage.delete(identifier,for_data=True)
Please feel free to make suggestions or ask questions
Platforms tested so far:
Code:
Windows XP SP3: Windows.RegistryKeyring
ATV2: Internal.PythonEncryptedKeyring
Ouya 1.0.12: Internal.PythonEncryptedKeyring
OSX 10.6.3: OS_X.Keyring
Ubuntu 13.10/XFCE: SecretService.Keyring
OpenELEC 3.0 x86_64: Internal.PythonEncryptedKeyring
Android - SG Note 3: Internal.PythonEncryptedKeyring
Raspberry Pi (Raspbmc): Internal.PythonEncryptedKeyring
iOS: NOT TESTED