Wednesday, August 17, 2011

How to Encrypt and Decrypt passwords in LoadRunner

How to Encrypt a password in LoadRunner?

Some times when you are recording an application, LoadRunner may not do the password encryption automatically. If it does, you will see lr_decrypt(“376347drjhd….”) in the password field otherwise, password is displayed as plain text.

LoadRunner provides a tool called “Password Encoder” which can be found under
Start > All Programs > HP LoadRunner > Tools
in Windows Environment

User Interface looks like this:


Fields Description:
Password: Enter the password you want to encrypt, and then click Generate.
Encoded String: Displays the encrypted password string.
Generate: Generates an encoded string after a password is entered.
Copy: Copies the encoded password string to the clipboard.
Once the password is encrypted, the screen appears as


Note: If you click on Generate again, a new encrypted string appears for the same password.
Click on Copy.

How to view Encrypted password?
You may have to view the password sometimes for some reason, and LoadRunner doesn’t provide any tool for Decrypting the password. So, How shall we view?

The simple technique is open a Web(HTTP/HTML) protocol and type the following statement into Action action and Run.

lr_log_message("%s",lr_decrypt("4e4b0e8ff417f9f9fd06a341ec1a"));

Note: The alphanumeric code displayed above is the encrypted password. Replace it with your code.

Result: HelloWorld will be displayed which is encrypted above.

Similarly, we can view encrypted passwords in QTP also.

No comments:

Post a Comment