Jump to content
Macro Express Forums

Save an encrypted variable to disk (in it's encrypted form)


Recommended Posts

We've been writing a fairly complex macro that includes subroutines for parsing html, vbs scripts for backround loading and processing into memory, etc. etc.


Essentially the macro will check to see if a file contains values for a username and password (stored in local %temp% directory)

if not found, it will prompt for them, and save them in that file.


Problem here is that the variables are stored in plain text, even though I'm using the encrypt method, when I save the string to a file, it is in plain text.


Any suggestions for a reliable way to save and recall encrypted passwords? I can write yet another vbs to do this for me via arguments, but I'd prefer to keep it in macro express if at all possible.



Link to comment
Share on other sites

When you use the Encrypted Text command it stores the encrypted value in the macro. But, as you discovered, there is not a way to store the encrypted value in an external file or in the registry. I have entered an issue in our tracking system to add this in a future release of Macro Express. This issue was assigned the tracking number [iSS5660]. In the meantime there are a couple of possible work-arounds:


1. You could use the Macro Express variable commands to encrypt and decrypt the passwords. However, this would only be as strong as your macro to encrypt or decrypt.


2. If you know what the login names and passwords are you could do the following:

- Add a Load Macro Text File command to your macro.

- When prompted edit the macro text file using the script editor.

- Enter two Encrypt Text commands.

- Save the text file.


Now when you run the macro it will set two text variables from the encrypted information contained in the macro text file you created. You can create several of these macro text files to support different passwords. You could even have your macro create these files for you. This technique does not, however, allow the user to select a password.

Link to comment
Share on other sites

  • 2 weeks later...

I started to write an encryption and decryption macro, but so far to make it truly secure it's too time consuming and a pita.


I had already tried Option 2, it does correctly encrypt the variables when you look at the text file, but it's only encrypting the phrase %T1% or %T2%, which when the macro ends, and the file is called later, will simply contain blank variables. Is there any way to tell it to dynamically write the macro file using the actual strings themselves instead of the variable strings like %T1% ?



Link to comment
Share on other sites

Option 2 can store the Encrypted Text command but, as you have already noticed, it cannot dynamically store the encrypted information. And if you use a var, the name of the variable is saved, not the content of the variable. I tried to work something out but was unsuccessful.


The request for commands to encrypt and decrypt has been added to our tracking system and assigned the tracking number [iSS5660].

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...