Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Password Encryption
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Password Encryption [Bug #193]
Page : 1 2 3
jesuisbenjamin English 58

jesuisbenjamin, Thursday 05 May 2011 à 13:20


Subscription date : 28 October 2009
Messages : 415
Heya

I've looked at the mail applet to see how the conf file deals with accounts and password. I've got few questions about that:

  • Does the widget automatically encrypts the password to the conf file?
  • Do i need to call a specific function to decrypt the password in the get_config() method? Is it keyfile.getpassword() or something?
  • How do you pick up account details from the keyfile before knowing the account names? I mean: i don't know before hand the name of accounts, but i'd need to specify the tab name, which is the account name written in brackets, as a first argument in the keyfile.getsomething() function. So is there any way to iterate the various accounts / tabs?


Thanks.

B.

matttbe, Thursday 05 May 2011 à 19:01


Subscription date : 24 January 2009
Messages : 12628
Hello,

Does the widget automatically encrypts the password to the conf file?
We can do that in C because we can use a function of the C API of Cairo-Dock to encrypt/decrypt a password. I guess you've to use a function in python to encrypt passwords but I don't know which function... So I guess the you've to look at Google!
But if you've to decrypt a password, the security wont be very high... (just unreadable for the user...)

How do you pick up account details from the keyfile before knowing the account names? I mean: i don't know before hand the name of accounts, but i'd need to specify the tab name, which is the account name written in brackets, as a first argument in the keyfile.getsomething() function. So is there any way to iterate the various accounts / tabs?
Maybe you can create one account (twitter/gmail/etc.) by section but if you want to access to 2 twitters accounts at the same time, you have to edit the .conf file. It seems you can easily do that with ConfigParser: http://docs.python.org/library/configparser.html (have a look to the first example: http://docs.python.org/library/configparser.html#examples => keyfile.add_section('Section1'); keyfile.set('Section1', 'int', '15'))

jesuisbenjamin, Thursday 05 May 2011 à 21:12


Subscription date : 28 October 2009
Messages : 415
Ha. I will look for encryption the.

Thanks for the tips.

jesuisbenjamin, Friday 06 May 2011 à 13:42


Subscription date : 28 October 2009
Messages : 415
Hi there,

with regard to multiple accounts: i tried to copy the mail.conf file section which adds a new account to my own conf file but the same widget is not reproduced.

The section i am talking about is:


#F[Add a mail account (you've to launch the applet)]
frame_mail=

#_ Add an account with specified type and name:
#{The new account will be created with the specified type and name.}
add account=



A helpful alternative for me would be a keyfile method to write to the conf file.

Any suggestions?

jesuisbenjamin, Tuesday 10 May 2011 à 16:42


Subscription date : 28 October 2009
Messages : 415
OK i completely missed out Matttbe's comment on how to write to the conf file

jesuisbenjamin, Wednesday 11 May 2011 à 22:52


Subscription date : 28 October 2009
Messages : 415
@Matttbe
What encryption base is used to encrypt password? I thought it was base64 but i was wrong

matttbe, Wednesday 11 May 2011 à 23:16


Subscription date : 24 January 2009
Messages : 12628
No, this is a custom encryption... => http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-core/cairo-dock/view/head:/src/gldit/cairo-dock-config.c

jesuisbenjamin, Wednesday 11 May 2011 à 23:46


Subscription date : 28 October 2009
Messages : 415
Wow... i can't read c really and even if i did i don't believe i could follow the encryption thing.
Can you tell me how that works or could you guys make a python binding for decryption?

matttbe, Wednesday 11 May 2011 à 23:56


Subscription date : 24 January 2009
Messages : 12628
No I think it's better to use a python module like base64 or bzip2. It's just to have something in a non-human readable form...

jesuisbenjamin, Thursday 12 May 2011 à 09:54


Subscription date : 28 October 2009
Messages : 415
matttbe :
No I think it's better to use a python module like base64 or bzip2. It's just to have something in a non-human readable form...


OK i'm fine with that but how do i get the password input widget on the configurations screen without it using your custom encryption?

matttbe, Thursday 12 May 2011 à 10:13


Subscription date : 24 January 2009
Messages : 12628
Ok I forgot that
So it's currently not possible...

jesuisbenjamin, Thursday 12 May 2011 à 12:30


Subscription date : 28 October 2009
Messages : 415
OK
then perhaps i can use a dialogue to request passwords for now?
let me know if/when you are planning to provide an alternative password widget please.

fabounet, Friday 13 May 2011 à 13:26


Subscription date : 30 November 2007
Messages : 17164
hmm, so you want to use the password widget (an entry with hidden characters, 'k'), but then you can't read the text in the conf file because it's encrypted ?
so what about a python function that would decrypt it ?
I think it's feasible to translate the C code into a small python function.

jesuisbenjamin, Friday 13 May 2011 à 13:29


Subscription date : 28 October 2009
Messages : 415
fabounet :
hmm, so you want to use the password widget (an entry with hidden characters, 'k'), but then you can't read the text in the conf file because it's encrypted ?
so what about a python function that would decrypt it ?
I think it's feasible to translate the C code into a small python function.


By all means, i'd like the python binding for descryption function

matttbe, Friday 13 May 2011 à 13:43


Subscription date : 24 January 2009
Messages : 12628
And why not just an entry with hidden characters? and then the dev can use the encryption that he wants to have...

fabounet, Friday 13 May 2011 à 13:43


Subscription date : 30 November 2007
Messages : 17164
agreed, although we don't need to add a Dbus method for that, since it's a small function it can be added inside the interface directly.
the C code is in cairo-dock-config.c, in case you want to try yourself

jesuisbenjamin, Friday 13 May 2011 à 13:50


Subscription date : 28 October 2009
Messages : 415
fabounet :
agreed, although we don't need to add a Dbus method for that, since it's a small function it can be added inside the interface directly.
the C code is in cairo-dock-config.c, in case you want to try yourself


I have no idea as to how i should bind python to c code

@ Matttbe:
I'm ok with a plain password widget, but that means i have get the password from the config, encrypt it, and rewrite it to the config right?

matttbe, Friday 13 May 2011 à 13:58


Subscription date : 24 January 2009
Messages : 12628
but that means i have get the password from the config, encrypt it, and rewrite it to the config right?
yes... maybe not so easy?

jesuisbenjamin, Friday 13 May 2011 à 14:03


Subscription date : 28 October 2009
Messages : 415
matttbe :
but that means i have get the password from the config, encrypt it, and rewrite it to the config right?
yes... maybe not so easy? :-?


it's do-able with two keys in the config. If there is a password entry, i get it, ecnrypt it, write it to password log, and clean password entry. It's just not the most elegant way of solving this though.

jesuisbenjamin, Saturday 14 May 2011 à 18:35


Subscription date : 28 October 2009
Messages : 415
OK i'm having some trouble with the keyfile (RawConfigParser Object) as i am trying to add and remove email accounts from the config file.

Basically keyfile.set(section, option, value) followed by keyfile.write(file) (where file is the conf file opened for writing), rewrites the entire conf file without comments (which erases the entire interface of course).

Is there any way to include comments in the keyfile?

Otherwise: does it mean i have to make my own config parser?

Thanks.
B.

Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Password Encryption [Bug #193]
Page : 1 2 3
jesuisbenjamin English 58


Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Password Encryption Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.