namedrisk Posted December 20, 2009 Share Posted December 20, 2009 (edited) Hi,I am currently using _INetGetSource to authenticate a user on my autoit code but if my user is using another language for example chinese, it seems to get the data from the page in chinese.Is there a way to grab it in english ? like an HTTP header or something ?UPDATEi've done some more tests and it sounds to be a problem with _StringEncrypt while trying to decrypt something on chinese language ... dont know how to solve this Edited December 20, 2009 by namedrisk Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 21, 2009 Share Posted December 21, 2009 The data you are getting is probably not encrypted with AutoIt's _StringEncrypt(), and so it can't be decrypted with it. A binary RC4() would be more likely to work, assuming you correctly handle the Unicode after it was decrypted. Now that assumes RC4() was used at all, and maybe it wasn't. So, how did you determine the encryption used? Nothing else works until you have the right answer to that question. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
namedrisk Posted December 22, 2009 Author Share Posted December 22, 2009 (edited) The data you are getting is probably not encrypted with AutoIt'sIt is. #include <String.au3> While 1 $this = InputBox("Enter text to encrypt", "!!") $this = _StringEncrypt(1, $this, "mysecretkeyhere", 1) ClipPut ($this) MsgBox(0, "hi", "The encrypted text is on your clipboard.") WEnd _StringEncrypt(0, "mysecretkeyhere", $line) It works over more then 50 computers with different language sets but if it is chinese it won't decode it... Thanks for coming by Edited December 22, 2009 by namedrisk Link to comment Share on other sites More sharing options...
namedrisk Posted December 28, 2009 Author Share Posted December 28, 2009 sorry to push it i am sure it may hard for you guys to test it on different languages etc ... but would there be another simple method to enc dec something like this one that would perhaps workout in diff languages ? it seems that it does not work with german, rus, dutch, chinese so far. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 28, 2009 Share Posted December 28, 2009 (edited) Find SkinnyWhiteGuy's RC4(), or the new Crypto.au3 UDF that ships with AutoIt. The point is to use an actual binary encryption/decryption that doesn't internally do string conversions (as _StringEncrypt() does) which is where language compatibility gets screwed up. Edited December 28, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Developers Jos Posted December 28, 2009 Developers Share Posted December 28, 2009 sorry to push it i am sure it may hard for you guys to test it on different languages etc ... but would there be another simple method to enc dec something like this one that would perhaps workout in diff languages ? it seems that it does not work with german, rus, dutch, chinese so far.I can assure you it works with Dutch but I know that there is a problem with Unicode http://www.autoitscript.com/forum/index.php?showtopic=62757&view=findpost&p=544033 SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
namedrisk Posted December 28, 2009 Author Share Posted December 28, 2009 (edited) Well right now i am with a client using dutch client trying to find out a fix for it that is why i also putted it on the list ... anyway thanks both of you i will try what you said Psalty and report how it goes. I have found this 2 topics of the needed files if i got it right: http://www.autoitscript.com/forum/index.php?showtopic=11513&hl=Cryptoau3&st=0 http://www.autoitscript.com/forum/index.php?showtopic=10813&st=0 I ran thru all the posts and everything and found a working version of the 2 files that does not give me any error for running but it does not work either as it ends without giving proper error message to autoit. i will keep looking on it but if you guys could give me a hand i would appreciate Edited December 28, 2009 by namedrisk Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted December 30, 2009 Share Posted December 30, 2009 Hi I can confirm there is a problem with _StringEncrypt with the chinese language .. i have the same problem .. (no i'm not chinese.. i had chinese food this evening ) Best regards, Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
monoceres Posted December 31, 2009 Share Posted December 31, 2009 _StringEncrypt is deprecated and not very good anyway. If you wish to use encryption with standard autoit then I recommend to use the Crypt UDF (like PsaltyDS said) instead, it ships with latest autoit (3.3.2.0) and is safer, faster and more flexible than _StringEncrypt. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
namedrisk Posted December 31, 2009 Author Share Posted December 31, 2009 i am using the follow function to overcome the problem and it works wonderfull: expandcollapse popupFunc __StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1, $i_Flag = 1) If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then SetError(1) Return '' ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then SetError(1) Return '' Else If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1 Local $b_EncryptText Local $b_EncryptPassword Local $v_EncryptModified Local $i_EncryptCountH Local $i_EncryptCountG Local $v_EncryptSwap Local $av_EncryptBox[256][2] Local $i_EncryptCountA Local $i_EncryptCountB Local $i_EncryptCountC Local $i_EncryptCountD Local $i_EncryptCountE Local $v_EncryptCipher Local $v_EncryptCipherBy $b_EncryptText = StringToBinary($s_EncryptText, $i_Flag) $b_EncryptPassword = StringToBinary($s_EncryptPassword, $i_Flag) If $i_Encrypt = 1 Then For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1 $i_EncryptCountG = '' $i_EncryptCountH = '' $v_EncryptModified = Binary('') For $i_EncryptCountG = 1 To BinaryLen($b_EncryptText) If $i_EncryptCountH = BinaryLen($b_EncryptPassword) Then $i_EncryptCountH = 1 Else $i_EncryptCountH += 1 EndIf $v_EncryptModified = Binary($v_EncryptModified) & Binary('0x' & Hex(BitXOR(BinaryMid($b_EncryptText, $i_EncryptCountG, 1), BinaryMid($b_EncryptPassword, $i_EncryptCountH, 1), 255),2)) Next $b_EncryptText = $v_EncryptModified $i_EncryptCountA = '' $i_EncryptCountB = 0 $i_EncryptCountC = '' $i_EncryptCountD = '' $i_EncryptCountE = '' $v_EncryptCipherBy = '' $v_EncryptCipher = '' $v_EncryptSwap = '' $av_EncryptBox = '' Local $av_EncryptBox[256][2] For $i_EncryptCountA = 0 To 255 $av_EncryptBox[$i_EncryptCountA][1] = Dec(StringTrimLeft(BinaryMid($b_EncryptPassword, Mod($i_EncryptCountA, BinaryLen($b_EncryptPassword)) + 1, 1),2)) $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA Next For $i_EncryptCountA = 0 To 255 $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256) $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0] $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0] $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap Next For $i_EncryptCountA = 1 To BinaryLen($b_EncryptText) $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256) $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256) $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0] $v_EncryptCipherBy = BitXOR(BinaryMid($b_EncryptText, $i_EncryptCountA, 1), $i_EncryptCountE) $v_EncryptCipher = Binary($v_EncryptCipher) & Binary('0x' & Hex($v_EncryptCipherBy, 2)) Next $b_EncryptText = StringTrimLeft($v_EncryptCipher,2) Next Else $b_EncryptText = $s_EncryptText For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1 $b_EncryptText = Binary('0x' & $b_EncryptText) $i_EncryptCountB = 0 $i_EncryptCountC = '' $i_EncryptCountD = '' $i_EncryptCountE = '' $v_EncryptCipherBy = '' $v_EncryptCipher = '' $v_EncryptSwap = '' $av_EncryptBox = '' Local $av_EncryptBox[256][2] For $i_EncryptCountA = 0 To 255 $av_EncryptBox[$i_EncryptCountA][1] = Dec(StringTrimLeft(BinaryMid($b_EncryptPassword, Mod($i_EncryptCountA, BinaryLen($b_EncryptPassword)) + 1, 1),2)) $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA Next For $i_EncryptCountA = 0 To 255 $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256) $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0] $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0] $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap Next For $i_EncryptCountA = 1 To BinaryLen($b_EncryptText) $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256) $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256) $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0] $v_EncryptCipherBy = BitXOR(BinaryMid($b_EncryptText, $i_EncryptCountA, 1), $i_EncryptCountE) $v_EncryptCipher = Binary($v_EncryptCipher) & Binary('0x' & Hex($v_EncryptCipherBy,2)) Next $b_EncryptText = $v_EncryptCipher $i_EncryptCountG = '' $i_EncryptCountH = '' $v_EncryptModified = '' For $i_EncryptCountG = 1 To BinaryLen($b_EncryptText) If $i_EncryptCountH = BinaryLen($b_EncryptPassword) Then $i_EncryptCountH = 1 Else $i_EncryptCountH += 1 EndIf $v_EncryptModified = Binary($v_EncryptModified) & Binary('0x' & Hex(BitXOR(BinaryMid($b_EncryptText, $i_EncryptCountG, 1), BinaryMid($b_EncryptPassword, $i_EncryptCountH, 1), 255),2)) Next $b_EncryptText = BinaryToString($v_EncryptModified, $i_Flag) Next EndIf Return $b_EncryptText EndIf EndFunc ;==>_StringEncrypt Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now