Encrypting a Password

Hi Guys,

Im after some assistance.

I have a script that calls a password from a document located on the host and them uses typetext to input the password on the SUT. The connection type is via IPKVM (VNC).

code
put file "C\location....\password.txt" into myData
typetext myData

this makes the script generic for multiple users/passwords.

We need to reduce the visibility of the password from eggplant, but as the log performs the action, so does it log what it is typing, ie the password.

Is there any way that i can call the password and set it to typetext but hide the action from the log?

I have played about with the encode function but obviously it only types the encoded text onto the SUT, not the original password (as far as i can workout).

Any thoughts on this would be appreciated.

Comments

  • with the release of 17.1.0 we have added 2 new commands
    EncodeText("text", "optionalKey")
    
    TypeEncodedText "text", "optionalKey"
    
    with these 2 commands you can type encoded text that does not go in the log file. You will have encode the text before and write the encoded information to the file
  • Hello, when i try the encode options, it does indeed encrypt the password on the log, but i have found it also types the encoded text onto the SUT, we need it to type the unencoded text onto the SUT but keep the password shown encoded on the log?

    That way, we can show others the log without giving the password away.

    Hopefully that makes sense
  • James.SkalaJames.Skala Member
    Another option would be to turn logging off for that particular step, which is what I've done with my scripts:
    Set the scriptlogging to Silent
    TypeText  password
    Set the scriptlogging to On
    

    This allows me to still have the password in my script or stored out on a file, but keeps it out of the logs.
  • dan6091dan6091 Member
    Thanks James,

    This was exactly what I wanted, worked brilliantly, now we have generic scripts that users can come and input there own creds with and then run.

    Thanks.
  • James.SkalaJames.Skala Member
    You're welcome, Dan. Glad I could help.
  • MAZAAMAZAA Member
    Another option would be to turn logging off for that particular step, which is what I've done with my scripts:
    Set the scriptlogging to Silent
    TypeText  password
    Set the scriptlogging to On
    

    This allows me to still have the password in my script or stored out on a file, but keeps it out of the logs.

    Thanks James. I am also searching for this functionality.
  • brett_xbrett_x Member
    James.Skala wrote:
    Another option would be to turn logging off for that particular step, which is what I've done with my scripts:

    Code:
    Set the scriptlogging to Silent
    TypeText password
    Set the scriptlogging to On


    This allows me to still have the password in my script or stored out on a file, but keeps it out of the logs.

    Yes, that's good. But a safer way is to store the current setting in another variable first, and then use the variable to set it back:
    put getoption (scriptlogging) into myLoggingSetting
    
    Set the scriptlogging to Silent 
    TypeText  password 
    
    set the scriptlogging to myLoggingSetting
    

    The difference is that you don't have to know the current setting. We assumed it was "on" in the example. But maybe it was "minimal". Using this method, we don't even have to know what it was.
    I do this with every option I have to change. It's a good way to keep things working as they are now. We like predictable results, right? ;)
Sign In or Register to comment.