Jump to content

BinaryToString special character issue


Recommended Posts

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.

Sincerely,

Todd C.

 

Link to comment
Share on other sites

send($Pasword,$SEND_RAW)
Check the help file for send options

"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

Link to comment
Share on other sites

  • Moderators

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

Quote

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

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

22 hours ago, Bowmore said:
send($Pasword,$SEND_RAW)
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. 

Todd

 

Edited by XF021209
addition
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...