Occasions may arise when you are dealing with sensitive data such as user names and passwords for a web application and as such you may not want this sensitive data to be visible within the actual .NET script. To deal with such scenarios the SilkTest Workbench provides the Encrypt method which allows for the encrypting of a given string, however as an Application Under Test does not expect the data being passed to it to be encrypted, you will have to decrypt the data prior to inputting it into the application.

To implement a solution for the above scenario you will need to do the following:

• Use the Encrypt() method to encrypt the use rnames (eg. sEncrypt = Agent.Encrypt(“myUserName”))
• Copy the encrypted strings into the Active Data File

Once you have done this you can implement a script similar to the sample script below which does the following:

1) Loads the encrypted user name names from the ActiveData into memory
2) Iterates through each row of data within the ActiveData file
3) Decrypt each of the usernames and assigns the decrypted string to a variable
4) Passes the decrypted as an input string for the SetText() method.