Notices


Reply
Thread Tools
Posts: 33 | Thanked: 4 times | Joined on Sep 2008 @ Mexico
#241
I can confirm too
 
titou1234's Avatar
Posts: 49 | Thanked: 17 times | Joined on Feb 2010 @ Paris, France
#242
Did someone already exported the data from PySafe or tried to use PySafe outside N900 (linux box) ?
 
Posts: 57 | Thanked: 20 times | Joined on May 2010 @ Florence, Italy
#243
is it possible to export? how?

i know that is possible to import, not export.
 
titou1234's Avatar
Posts: 49 | Thanked: 17 times | Joined on Feb 2010 @ Paris, France
#244
Hi,

I have done a small python script to export a pysafe database to a KeePassX xml file. The generated file is not encrypted, it is intended for the import option of KeePassX.

Steps to use it:
1°) Getting on your PC a Python runtime (I cannot help you for this)
2°) Download the attached zip file and unzip it in a directory. You should now have a convert_pysafe.py file.
3°) Download from your N900 your pysafe database (the name is pysafe.sqlite at the root when connected in USB) and copy it in the same directory
4°) Modify the script for the password: in the line 128 replace the "YOUR_PYSAFE_PASSWORD" with your pysafe password
5°) pysafe does not have predetermined fields to store informations (username, password), so you have to tell the script which of your fields have to be used for password and username. The not recognized fields will go in the comment field.

To have a detail (the name of the fields in pySafe) stored in the username field, you have to provide its name in a line.
For example, to include the details username, login and Email, you have to write (line 160) keep it on one line:
Code:
if username == "" and (tag == "username" or tag == "login" or tag == "Email"):
If you want to include other details, just add another
Code:
or tag == "login"
Do not modify the begining of the line and all the spaces before
Code:
if username == "" and (
and the end of the of the line
Code:
):
.
Be careful, details name are case sensitive, so Username and username are two different details name, so you have to write
Code:
or tag == "Username" or tag == "username"
Same goes for the password detail in the line 162.

I am sorry, this is not very user friendly to say the least, but this is my first python script
6°) execute the script
Code:
python convert_pysafe.py
It will output the not recognized details / fields which will be stored in the comment field.


The script does not modify the original database, so you can execute it multiple times if needed.

The biggest part of the script comes from the pysafe sources, so thank you to jaguilar to release it in Open Source.

I hope it is not too complicated, and can be useful.

Ithier
Attached Files
File Type: zip convert_pysafe.zip (2.1 KB, 114 views)
 

The Following 2 Users Say Thank You to titou1234 For This Useful Post:
Posts: 5 | Thanked: 1 time | Joined on Jan 2010 @ UK
#245
Originally Posted by titou1234 View Post
Hi,

I have done a small python script to export a pysafe database to a KeePassX xml file. The generated file is not encrypted, it is intended for the import option of KeePassX.

[...]

I hope it is not too complicated, and can be useful.

Ithier
This is exactly what I was looking for. I've recently moved from n900 to iPhone (I know, I know - in the end the software universe was just too tempting!). Now I've got my data extracted using your script and the excellent port of 'PasswordSafe' - pwsafe - running on my iphone (and ubuntu laptop) I can try and import my passwords rather than typing them all in again.

Open source wins the day once again - even if its open source running on a closed source system.

[Update]
I've just successfully managed to use a modified version of this script to extract to a PasswordSafe compatible XML then import via the Java version of PasswordSafe on ubuntu. I keep my safe database and share it through Dropbox with the iphone app pwsafe.

I had to update the script - mainly to output a group entry for each pwentry, rename database to pwlist, entry to pwentry and comments to notes. I then had to strip out some ampersand characters in the data which broke the Java import on PasswordSafe.

To keep these entries separate in PasswordSafe I also prepended the word 'Import.' to the group entry so it loads them in under a group folder called 'Import'.

The modified script is included below for anyone who wants to use it - don't forget to change the password entry (pysafe_password) and if you have trouble importing check your XML output file for unusual characters. Good luck!
Attached Files
File Type: gz cpmweb_convert.tar.gz (2.1 KB, 102 views)

Last edited by cpmweb; 2011-12-22 at 13:28.
 

The Following User Says Thank You to cpmweb For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:34.