Encryption
There are 2 simple ways to encrypt a password or any text in UFT (QTP).
- First simple way is using the Password Encoder Utility provided by HPE along with the installation of QTP.
To encode any string, open this utility from the below path:
C:Program Files (x86)HPUnified Functional TestingbinCryptonApp.exe

Now, enter the password/string to be encrypted in the Password field and Click on ‘Generate’ button.
The ‘Encoded string’ is generated in fraction of a second and we’re ready to go.
2. Another way is by using ‘Crypt’ utility Object
Code:
strPwd = “abc123”
varA = Crypt.Encrypt(strPwd)
MsgBox varA

Decryption
Now that we have learnt how to encrypt a password, we may also understand how to Decrypt an encrypted password.
Below is the code to do the same:
Browser(“micclass:=Browser”, “index:=0”).Page(“micclass:=Page”,”index:=0″).WebEdit(“micclass:=WebEdit”, “index:=0”).SetSecure sEPwd
‘Displaying the Decrypted Value
MsgBox Browser(“micclass:=Browser”, “index:=0”).Page(“micclass:=Page”,”index:=0″).WebEdit(“micclass:=WebEdit”, “index:=0”).GetROProperty(“text”)