Release (beta) Password Storage
#1
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:

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 Smile




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
Reply
#2
Version 0.1.1

Changes:
- Added encrypt() and decrypt() functions

On my REPO.
Reply
#3
Version 0.1.2

Changes:
- Added delete() function

On my REPO.
Reply
#4
Version 0.1.4

Changes:
- Internal keyring now defaults to storing random keyring key to disk

On my REPO.

This is less confusing to users. They can always clear it in settings if they want to increase password security.
Reply
#5
Information 
Version 0.1.6

Changes:
  • Fix for infinite loop on wrong keyring password entry
  • Added RESET KEYRING option to Password Storage manager
  • Fixes for display updates when changing password options
  • Added and improved dialogs for password retrieval failure

On my REPO.
Reply
#6
Information 
Version 0.1.7

Changes:
  • Fix for import errors on Ouya and perhaps other platforms

On my REPO.
Reply
#7
Information 
Version 0.1.8

Changes:
  • Update keyring core to most recent version
  • Fix for windows falling back to internal keyring
  • Fix for errors on OSX

On my REPO.

This should work all around now. I tested on Ouya, Win 8, OSX and Ubuntu.
Reply
#8
Version 0.1.9

Changes:
  • Remove support for SecretService keyring and Gnome keyring as they are broken because of a DBus issue with XBMC

On my REPO.
Reply



Logout Mark Read Team Forum Stats Members Help
(beta) Password Storage0
This forum uses Lukasz Tkacz MyBB addons.