Wednesday, July 12, 2006

Recovering passwords from WebSphere

WebSphere stores passwords for datasources, security aliassss, etc in an encrypted format in its configuration files. The format, called XOR (exclusive OR), is not a particularly strong encryption algorithm, probably designed just to stop casual snooping. (In contrast WebLogic uses triple-DES encryption.)

(To be precise IBM says WebSphere "encodes" paswords, not encrypts them.)

When you forget that password to your development database it can be useful to have the ability to decrypt XOR-encrypted passwords. Fortunately IBM have provided the means to encrypt and decrypt passwords in XOR format (although they probably didn't mean to leave the code around for general use).

So lets encrypt the password "secret":

WebSphere 5.x

> ../java/bin/java -cp securityimpl.jar:iwsorb.jar secret
decoded password == "secret", encoded password == "{xor}LDo8LTor"

WebSphere 6.0.x

> ../java/bin/java -cp securityimpl.jar:iwsorb.jar::ras.jar:wsexception.jar:bootstrap.jar:emf.jar:ffdc.jar secret
decoded password == "secret", encoded password == "{xor}LDo8LTor"

and to decrypt (don't forget to prefix the encoded password with "{xor}"):

WebSphere 5.x

> ../java/bin/java -cp securityimpl.jar:iwsorb.jar {xor}LDo8LTor
encoded password == "{xor}LDo8LTor", decoded password == "secret"

WebSphere 6.0.x

> ../java/bin/java -cp securityimpl.jar:iwsorb.jar::ras.jar:wsexception.jar:bootstrap.jar:emf.jar:ffdc.jar {xor}LDo8LTor
encoded password == "{xor}LDo8LTor", decoded password == "secret"

UPDATE: IBM have heard the cries about poor password security and have added hooks from WebSphere 6.0.2 onwards that allow you to write your own password encryption. One step forward...


Anonymous said...

That's awesome!!

WOuld like to keep watching your blog for any such further info.



Anonymous said...

It does not appear to work for 6.1 - any ideas?

Robert Maldon said...

I do not have access to a WAS 6.1 at the moment. Does the main() method not exist any more, or is a dependent class missing from the classpath? Got a stack trace?

Snark said...

For WAS 6.1, do the following:

To encode:

C:\IBM\WAS61\AppServer\bin\ProfileManagement\plugins\>C:\IBM\WAS61\AppServer\java\bin\java -cp ws_runtime.jar secret
decoded password == "secret", encoded password == "{xor}LDo8LTor"

To decode:

C:\IBM\WAS61\AppServer\bin\ProfileManagement\plugins\>C:\IBM\WAS61\AppServer\java\bin\java -cp ws_runtime.jar {xor}LDo8LTor
encoded password == "{xor}LDo8LTor", decoded password == "secret"

Change C:\IBM\WAS61 as needed.


Snark said...

Full directory has been truncated. Here it is, splitted line by line:


Robert Maldon said...

Awesome, thanks for the WAS 6.1 example.

Anonymous said...

I do not see "" in plugins directory.

I use WAS ND

So unable to use the was6.1 decode or encode methodology provided here.

Anonymous said...

ok there are two plugins directories.

The plugins directory under ${WAS_HOME} does not have "". When searched for "", i found it under ${WAS_HOME}/deploytool/itp/plugins directory.

So guess for different versions its at different location.
Anyways thanks guys...

Ranga Raju said...

Just wanted to share how it worked for me.

WebSphere 6.1.x:

To Encrypt:

/opt/WebSphere/DeploymentManager/deploytool/itp/plugins>${WAS_HOME}/java/bin/java -cp ws_runtime.jar secret
decoded password == "secret", encoded password == "{xor}LDo8LTor"

To Decrypt:

/opt/WebSphere/DeploymentManager/deploytool/itp/plugins>${WAS_HOME}/java/bin/java -cp ws_runtime.jar {xor}LDo8LTor
encoded password == "{xor}LDo8LTor", decoded password == "secret"

Anonymous said...

did anyone try to break the password from the fileRegistry.xml file in WAS 6.1 (VMM)

Anonymous said...

For the curious, the file repository is stored under your profile in: $WAS_HOME\profiles\profileName\config\cells\cellName\fileRegistry.xml. This file contains user and group identifiers, including the encrypted passwords for the user entries. The passwords for a user is encrypted using a one way hash by applying the message digest algorithm specified in the VMM configuration file (wimconfig.xml). The default value for the message digest algorithm is SHA-1. The algorithm can be updated to a different value using the wsadmin command updateIdMgrFileRepository. One of the parameters you can use with this command is the messageDigest Algorithm.


Olov D said...

Is there a way to encode and decode passwords programmatically as well?

Robert Maldon said...

The amount of code to encode/decode passwords is small, but it is proprietary IBM and therefore not in the public domain.

I won't mention tools like JAD...

Darshan Shroff said...

One of the best posts that i have ever read. This is just too much of priceless Websphere Security information in too small a packet. Kudos to the link that directed me here.

Harish said...

Hi All,

I have a basic question with regards to decrypting and encrypting WAS admin passwords in XOR format

My workstation information

RSA 7.5
Windows XP

I know the user name for my
WAS 6.1 server as wasadmin
password to be identified.(I don't remember it )

Now I know the path to WAS 6.1 plugin as given in the blog as


I don't have the password nor the encrypted password.


How do I find it?

Where to find it?

What command should I use?

As per the blog

>C:\IBM\WAS61\AppServer\java\bin\java -cp ws_runtime.jar {xor}LDo8LTor
encoded password == "{xor}LDo8LTor", decoded password == "secret"

Please let me know ASAP.

Any help would be greatly appreciated.

Thanks & Best Regards


Anonymous said...

WAS 6 actually has built in scripts for encoding the passwords for the ssl.client.props and soap.client.props... I'm assuming you can use it for other file names as well...

EX: cd /path/to/was/profile
EX: cd /apps/WebSphere/AppServer/profiles/someprofile/bin

Run: ../bin/ filename password_variable

EX: ../bin/ ssl.client.props

Sai Hegde said...


Anonymous said...

WebSphere 7: /usr/IBM/WebSphere/AppServer/java/jre/bin/java -Djava.ext.dirs=/WAS7/IBM/WebSphere/AppServer/deploytool/itp/plugins/ -cp securityimpl.jar:iwsorb.jar {xor}encryptedpass=

Andy Jones said...

Here is a link to an online WebSphere password decoder:

Anonymous said...

This is great blog. It really helped me....... to find our forgotten password of production

Anonymous said...

really its works a lot.

Anonymous said...

There is an online decoder at this link:

Sha said...

Guyz - How to decode the WAS password in WAS8 ? I know abt the online decoder .but here im looking for command line
with ws_runtime.jar ? Is anyone decoded in WAS8?

Marcel Friedmann said...

Decoding passwords also works in WebSphere 8 and 8.5 but with a slightly different command