Jump to content

About _StringEncrypt()


Recommended Posts

I know _StringEncrypt() used to encode and decode a string.

But it can't use them for UNICODE Characters, please help me.

Example, when I do function encrypt _StringEncrypt(1,"Nản","a",1),it returns CD1237C4EA7F

And when I do decrypt _StringEncrypt(0,"CD1237C4EA7F","a",1), it returns N?n!]

Please help, thanks alot!

for(loop=0; loop<infinity; loop++) { alert('I love you'); }

Link to comment
Share on other sites

hi there!

possibly here??

I don't know, but it seems to be a similar problem you are getting here.

http://www.autoitscript.com/forum/index.php?showtopic=93644

Could you show me the way to solve my problems, I can't get it clearly from http://www.autoitscript.com/forum/index.php?showtopic=93644, thanks alot!

for(loop=0; loop<infinity; loop++) { alert('I love you'); }

Link to comment
Share on other sites

What I was trying to indicate, and what someone in that thread failed to relise is that it is more than likely you corrupting the characters, not stringEncrypt. I may be wrong, and I am not the most knowledgable person on this topic by any stretch of the imagination.

Make sure whatever text editor etc you are using is set to the right settings, as mentioned by valik in the thread.

Other than that, I cannot help you unless you post the editor you are using as well as the settings you have already changed. Just post any info that may have been affecting the output.

MDiesel

Link to comment
Share on other sites

Derived from ProgAndy's code here:

#614497

#include <String.au3>

Global Const $SF_ANSI = 1
Global Const $SF_UTF8 = 4

$TestString_Raw = "Кириллица"

; Test 1
$TestString_Enc = _StringEncrypt(1, $TestString_Raw, "password", 1)
$TestString_Dec = _StringEncrypt(0, $TestString_Enc, "password", 1)
MsgBox(0,"Test 1, no conversion",$TestString_Raw & @crlf & $TestString_Enc & @crlf & $TestString_Dec)

; Test 2
$TestString_Enc = _StringEncrypt(1, BinaryToString(StringToBinary($TestString_Raw, $SF_UTF8), $SF_ANSI), "password", 1)
$TestString_Dec = BinaryToString(StringToBinary(_StringEncrypt(0, $TestString_Enc, "password", 1), $SF_ANSI), $SF_UTF8)
MsgBox(0,"Test 2, string converted", $TestString_Raw & @crlf & $TestString_Enc & @crlf & $TestString_Dec)
Link to comment
Share on other sites

Derived from ProgAndy's code here:

#614497

#include <String.au3>

Global Const $SF_ANSI = 1
Global Const $SF_UTF8 = 4

$TestString_Raw = "Кириллица"

; Test 1
$TestString_Enc = _StringEncrypt(1, $TestString_Raw, "password", 1)
$TestString_Dec = _StringEncrypt(0, $TestString_Enc, "password", 1)
MsgBox(0,"Test 1, no conversion",$TestString_Raw & @crlf & $TestString_Enc & @crlf & $TestString_Dec)

; Test 2
$TestString_Enc = _StringEncrypt(1, BinaryToString(StringToBinary($TestString_Raw, $SF_UTF8), $SF_ANSI), "password", 1)
$TestString_Dec = BinaryToString(StringToBinary(_StringEncrypt(0, $TestString_Enc, "password", 1), $SF_ANSI), $SF_UTF8)
MsgBox(0,"Test 2, string converted", $TestString_Raw & @crlf & $TestString_Enc & @crlf & $TestString_Dec)
Thanks alot. it is really helpful. it works!

for(loop=0; loop<infinity; loop++) { alert('I love you'); }

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...