How do I encrypt passwords for other applications

Michael W.
Lititz, PA

Dec 23, 2008
30 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

I am using ATEasy to launch other applications that we use every day.  These applications ask for a username and password, which is most likely different than what is used for ATEasy.  I would like to have the user type in the password once and then I would store it in an encrypted file.  How do I do that?

Amit G.
Irvine, CA

Dec 23, 2008
26 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

You can store encrypted data within an ATEasy driver (.drv file).

To do this follow these steps:

1. Create a new driver and select "Use File Encryption" under the Sharing tab of the Driver's properties.

2. Right Click on the driver icon (NOT the driver shortcut) and select "Insert folder below" and save the driver file

3. Now you can access the Driver.MiscFolder.Tag property to get and set passwords and usernames. You can create driver module procedures for setting and getting data from this property. The Tag property is of type variant so you can store an array of strings, structures etc. that represent the usernames/passwords that you wish to store. Once you have assigned data to the Tag field, it will be stored within the .Drv file in an encrypted format.

DrATEasy (Ron Y.)
Mission Viejo, CA

Dec 23, 2008
358 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

If you like to store the file in external file you can also can use .the ProtectedData .NET class.

The following link has an example for similar problem:

http://msdn.microsoft.com/en-us/library/ms229741.aspx

Michael W.
Lititz, PA

Jan 5, 2009
30 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

Amit's solution doesn't work for me unless I am missing something.  I programmatically assigned a simple string to the Driver.MiscFolder.Tag property and then exited ATEasy.  When I restarted ATEasy, the Driver.MiscFolder.Tag property was empty.  The only way the Tag is saved to the driver file is to type in the Tag text box.

Amit G.
Irvine, CA

Jan 5, 2009
26 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

Try using the following code:

Users.Login("Administrator","password123")
Users.CurrentUser.Tag = myVar

Now if you close ATEasy and reopen it, the value of Users.CurrentUser.Tag should be saved. The Tag member is a variant so you can store any object or structure. The user data (stored in the Users variable of type AUsers) is stored using encryption. In the example above, I logged into the Administrator account with the password "password123", but this should work for any account you have defined in ATEasy. By default the Administrator account has no password (so you would use "" as the password)

If you are using the above code and want to protect any ATEasy passwords that you may use in your code (with the Users.Login method), you can encrypt your Program, System, or Driver file as well as require a password to view the code within them by setting an access password in the properties dialog box under the "Sharing" tab with the "Read" option selected under the Access drop down menu.

Michael W.
Lititz, PA

Jan 6, 2009
30 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

Amit, I'm sorry, but your method just won't work for my situation.  I think my best bet is Ron's suggestion.  Ron, can you please supply some ATEasy code to get me rolling?  I would greatly appreciate it.

Amit G.
Irvine, CA

Jan 6, 2009
26 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

Michael,
I have attached an example ATEasy project and program that uses the Rijndael algorithm to encrypt data to a file. The example then reads the file and decrypt its contents. The password you use when decrypting the file must be the same one used when encrypting it.


File Attachment:
Encrypt.zip

Solution Available
Amit G.
Irvine, CA

Jan 6, 2009
26 Posts

1  |  0  

Re: How do I encrypt passwords for other applications

The above example can also be slightly modified to use the TripleDES algorithm (instead of Rijndael AES) if desired.

Michael W.
Lititz, PA

Jan 13, 2009
30 Posts

0  |  0  

Re: How do I encrypt passwords for other applications

The example code works great.  Thanks!



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]