BinaryToString special character issue

4 posts in this topic

I'm having a small issue with use of the BinaryToString function and not finding anything in search on the forum. Here's the short of it:

I am encrypting a password and storing that in a file. I open the file reading in the encrypted password into a variable. I use a msgbox function to display the un-encrypted password. It shows correctly. I use the Send function to type the password into a password box in IE. When I click on the password unmask icon (the dot with the curved underscore line), the password is missing the last character. The last character happens to be an exclamation point "!".

So, the password is encrypted as: ThisPassword!

The password displays in the msgbox using the variable assigned to hold the decrypted password as: ThisPassword!

After using the send function and the ******* appears in the password window, clicking on the password unmask icon, what is displayed is: ThisPassword

Missing the "!"

I'm not sure why this is occurring.

      Local $dEncrypted = FileRead("C:\Users\_user\Documents\AutoIT\Credential.txt")
      Local $bEncrypted = _Crypt_DecryptData($dEncrypted, $sUserKey, $CALG_RC4)

      Local $Password = BinaryToString($bEncrypted)
      msgbox(0,"",$Password,0); Displays ThisPassword! in the message box window 

      Send($Password); Displays ThisPassword when the password unmask icon is clicked

I know I'm missing something simple, but can't seem to figure out what it is. Any help is greatly appreciated.


Todd C.


Share this post

Link to post
Share on other sites
Check the help file for send options
1 person likes this

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post

Link to post
Share on other sites

Moved to the appropriate forum, as the DEV forum very clearly states:


Do not create AutoIt-related topics here, use AutoIt General Help and Support


√-1 2^3 ∑ π, and it was delicious!

Share this post

Link to post
Share on other sites

#4 ·  Posted (edited)

22 hours ago, Bowmore said:
Check the help file for send options

Thank you for the direction. I'll try that and see how it works. Greatly appreciated.

Of course looking at it now, I clearly see that I needed to look at SEND and not at BinaryToString which is what I kept searching for an answer.  One of the best things about AutoIT is that the Help file is extremely helpful if you look in the right place. I maintain a lot of commercial apps that don't even come close. Thanks again. 



Edited by XF021209

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now