Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jignesh Vachhani
Password Decryption
February 10, 2012 4:18 AM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 780

Join Date: March 10, 2008

Recent Posts

Hi Everyone,

I want to decrypt all user passwords from md5 format.
I want it in plain text .

As per my knowledge decryption doesn't support in liferay for security purpose.
If anyone have idea, how can we do that ? then please share it .
Jelmer Kuperus
RE: Password Decryption
February 10, 2012 5:20 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

MD5 hashes are designed to be non reversible. Do there is no easy way to reliably obtain the plain text passwords (other than brute force or dictionary attacks)
Jignesh Vachhani
RE: Password Decryption
February 12, 2012 11:05 PM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 780

Join Date: March 10, 2008

Recent Posts

Thanks Jelmer,

I was looking for this final answer only as i was little bit confused.
Once again thanks a lot for your reply.
Mazhar Alam
RE: Password Decryption
February 17, 2012 12:21 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Hi Jignesh,

You can set in portal-ext.properties to access your passwords-

passwords.encryption.algorithm=NONE

Regards
Hitoshi Ozawa
RE: Password Decryption
February 17, 2012 3:13 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

passwords.encryption.algorithm=NONE


This will store your password in plain text. This means your db admin would be able to see all including admin's password.
Also, be aware that you have to set this before you first startup Liferay because changing password encryption may result in not being able to login.
Mazhar Alam
RE: Password Decryption
February 17, 2012 3:51 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

I agree that the passwords changes into plain text.

Is there any means to fetch the Password from the database table of any respective user.?

Thanks in advance
Hitoshi Ozawa
RE: Password Decryption
February 17, 2012 5:21 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

After you set the password to be in plain text, you'll be able to look at the column "password_" in the table "user_".

You may be able to use Liferay api to get the user and do user.getPassword()
Arcko Duan
RE: Password Decryption
February 17, 2012 10:06 PM
Answer

Arcko Duan

Rank: Regular Member

Posts: 202

Join Date: October 15, 2007

Recent Posts

You could change to use other encryption method like DES for your password.
Jignesh Vachhani
RE: Password Decryption
February 19, 2012 10:54 PM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 780

Join Date: March 10, 2008

Recent Posts

Thanks to all guys,

As passwords are saved in encrypted format in my DB.
But I think I need Decrypted formated passwords from DB and as per the suggestion given by Jelmer its not possible.
Ravi Kumar Gupta
RE: Password Decryption
February 19, 2012 11:31 PM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1212

Join Date: June 23, 2009

Recent Posts

i guess when Liferay stores password in session(see properties file) it stores when user is logging in. And no way we can decrypt password from a hash.

Jignesh, If you are in need to get password from db. You can write your own algo to encrypt and decrypt like RSA(or simply use RSA). You can have public and private key per portal to encrypt/decrypt passwords only using keys of that portal. This way even admin will not be able to get passwords simply and it will be secure.

HTH
Jignesh Vachhani
RE: Password Decryption
February 19, 2012 11:36 PM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 780

Join Date: March 10, 2008

Recent Posts

Yes Thats Right Ravi,
So for confirmation only I just posted this thread so now if any other users have this kind of requirement, they can get nice answers from here.
Thanks to all who have contributed their answers here.
Mazhar Alam
RE: Password Decryption
February 21, 2012 9:17 PM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Hi ravi,

You told that Liferay stores password in session i.e in some property file ,it stores when user is logging in- so can you please tell me in which property file it stores the password.

Thanks in advance.
Ravi Kumar Gupta
RE: Password Decryption
February 21, 2012 9:24 PM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1212

Join Date: June 23, 2009

Recent Posts

Mazhar, Its not stored in property file. We use a property so that liferay understands and stores password in session when user logs in.

See this property
1
2    #
3    # Set this to true to store the user's password in the session.
4    #
5    session.store.password=false
Mazhar Alam
RE: Password Decryption
February 21, 2012 10:16 PM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Ok Ravi, got it.
Thanks!
Ashok Sangi
RE: Password Decryption
February 27, 2012 10:59 PM
Answer

Ashok Sangi

Rank: New Member

Posts: 10

Join Date: November 21, 2011

Recent Posts

hi majhar

if i follow yours posted ans can i see all the plain text passwords in d.b
Ravi Kumar Gupta
RE: Password Decryption
February 28, 2012 11:32 PM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1212

Join Date: June 23, 2009

Recent Posts

Hi Ashok,

You will see all the passwords in plain text in db after setting that property. But it should be done at the first start up of the portal. So that Liferay can build database accordingly.

-Ravi
Mazhar Alam
RE: Password Decryption
March 2, 2012 3:09 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Ashok,
Yes u can see all the passwords in plain text.
Also
Go through ravi's comment too. :-)
Ashok Sangi
RE: Password Decryption
March 26, 2012 3:52 AM
Answer

Ashok Sangi

Rank: New Member

Posts: 10

Join Date: November 21, 2011

Recent Posts

thank you , now i can see the plain text pwds