Can Katalon provide a method to decrypt the encrypted string

Let say currently i stored the katalon encrypted password in custom profile, and i need it to use for email/DB connection, that will be a problem because i can’t decrypt the string to use in my own script.

The problem is I am not passing the encrypted password to the web element, so i can’t use WebUI.setEncryptedText (testObject, String)

If Katalon can provide something below will be really helpful.

WebUI.getEncryptedText(internal.GlobalVariable.password)

4 Likes

You can use CryptoUtil:

import com.kms.katalon.util.CryptoUtil

def originalText = 'mypassword'
println("Original text: ${originalText}")

def encryptedText = CryptoUtil.encode(CryptoUtil.getDefault(originalText))
println("Encrypted text: ${encryptedText}")


def decryptedText = (CryptoUtil.decode(CryptoUtil.getDefault(encryptedText)))
println("Decrypted text: ${decryptedText}")
9 Likes

Thank you Alex. your solution work for me.

1 Like