AutoHotkey Community

It is currently May 27th, 2012, 12:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: December 8th, 2011, 2:01 am 
Offline

Joined: December 2nd, 2010, 12:25 am
Posts: 73
Location: Ontario, Canada
I Have the same Issue here. I just Downloaded the latest version to be sure and rebooted after install. Same issue

sinkfaze wrote:
daveerickson wrote:
I must really be missing something up here...


No, I'm pretty sure you just downloaded the latest version of AHK_L, in which the var prefix is no longer allowed inside of classes:

Code:
var StrEncoding := "UTF-16"


I believe if you change those instances from var to static it should work fine.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2011, 2:07 am 
Offline

Joined: December 2nd, 2010, 12:25 am
Posts: 73
Location: Ontario, Canada
Changed line 146 static StrEncoding := "UTF-16"
Changed line 147 static PassEncoding := "UTF-16"
Changed line 415 static StrEncoding := "CP0"
Changed line 416 static PassEncoding := "UTF-16"

It works for me now. Win 7 x64

sinkfaze wrote:
daveerickson wrote:
I must really be missing something up here...


No, I'm pretty sure you just downloaded the latest version of AHK_L, in which the var prefix is no longer allowed inside of classes:

Code:
var StrEncoding := "UTF-16"


I believe if you change those instances from var to static it should work fine.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2011, 9:37 am 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
hello, guys, i've updated the source and fixed the problem with old "var" definition and bad password len calculating

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 13th, 2011, 10:27 am 
Offline

Joined: February 17th, 2011, 2:29 pm
Posts: 4
Location: BARCELONA CATALONIA
Sorry for my English. I think the method "StrDecryptToFile" has a file delete crypt.temp early because it gives me error opening the site have changed and it works


FileDelete,% temp_file
if !bytes := this._Encrypt( p, pp, password, 0, temp_file, ..... )
return ""


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2011, 5:58 pm 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
JMeneses
yep, you right, it was a bug there
i have uploaded a fixed version

thank you!

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2012, 10:49 pm 
Hi Deo,

Is it Okey to use this library for my apps? Is there a license that restricts certain things?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2012, 5:36 am 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
Hi
You may use/change this lib as you wish without any restrictions

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2012, 5:40 am 
Wao, thank you so much, Deo. Bless you. :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2012, 3:49 am 
Hi Deo,

Is it possible to decrypt binary data loaded in memory? I mean something like this,
Code:
Data := "Hello World!"
FileAppend, % Data, %A_ScriptDir%\tmp.txt, UTF-8
Crypt.Encrypt.FileEncrypt( A_ScriptDir "\tmp.txt", A_ScriptDir "\sample.dat", "mypassword", 7, 6)
FileDelete, %A_ScriptDir%\tmp.txt

; assuming the above has been done somewhere
FileRead, Hash, *c %A_ScriptDir%\sample.dat
msgbox %  Crypt.Encrypt.StrDecrypt(Hash, "mypassword", 7, 6)   

Actually, I'm looking for a way to decrypt text from resource in a compiled script. The text is stored in the executable and is possible to load into memory. I need to decrypt the loaded data. In order to do it, I'd like to know whether the above task is possible with your library. Thanks.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2012, 8:28 am 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
Hi,
sure, here is how you can do this:
Code:
;read file's data into memory buffer
f := fileOpen( "sample.dat", "r", "CP0" )
bufSize := f.RawRead( buffer, f.Length )
f.close()
;-------First Method
Crypt.Encrypt.StrEncoding := "UTF-8" ;specify a needed encoding here, "UTF-16" is by default
;get hashed string of data since StrDecrypt use it as first parameter
hashedData := ByteToHash(buffer,bufSize)
msgbox % Crypt.Encrypt.StrDecrypt( hashedData, "mypassword", 7, 6)

;-------Second Method, a bit faster than first
if Crypt.Encrypt._Encrypt( buffer, bufSize, "mypassword", 0,0,0,7,6)
   msgbox % strget(&buffer,"UTF-8") ;specify a needed encoding here

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2012, 7:47 pm 
Hi Deo,

I get EOT characters at the end of the result string. Could you check if it happens in your environment? I'm using Unicode x86 and the script is saved as UTF-8.
Code:
Data := "Hello World!"
FileAppend, % Data, %A_ScriptDir%\tmp.txt, UTF-8
Crypt.Encrypt.FileEncrypt( A_ScriptDir "\tmp.txt", A_ScriptDir "\sample.dat", "mypassword", 7, 6)
FileDelete, %A_ScriptDir%\tmp.txt
; assuming the above has been done somewhere

;read file's data into memory buffer
f := fileOpen( A_ScriptDir "\sample.dat", "r", "CP0" )
bufSize := f.RawRead( buffer, f.Length )
f.close()

;-------First Method
Crypt.Encrypt.StrEncoding := "UTF-8" ;specify a needed encoding here, "UTF-16" is by default
;get hashed string of data since StrDecrypt use it as first parameter
hashedData := ByteToHash(buffer,bufSize)
msgbox % Crypt.Encrypt.StrDecrypt( hashedData, "mypassword", 7, 6)

result wrote:
Hello World!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2012, 9:09 am 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
hi
there was bug in StrDecrypt related to inproper string len calculation. I fixed it and upload new version, take it and try again.
and thanks that you found it! ;)
also, the second method should look like this now (if you'll prefer it ):
Code:
encoding = "UTF-8" ;specify a needed encoding here
if sLen := Crypt.Encrypt._Encrypt( buffer,bufSize, "mypassword", 0,0,0,7,6 )
{
  if ( encoding  = "utf-16" || encoding = "cp1200" )
    sLen /= 2
  msgbox % strget(&buffer,sLen,encoding )
}

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 12:21 am 
Hi Deo,

Glad to know the bug has been fixed. The first method works perfectly. I get a blank message box though with the second revised method. Am I using it correctly?
Code:
Data := "Hello World!"
FileAppend, % Data, %A_ScriptDir%\tmp.txt, UTF-8
Crypt.Encrypt.FileEncrypt( A_ScriptDir "\tmp.txt", A_ScriptDir "\sample.dat", "mypassword", 7, 6)
FileDelete, %A_ScriptDir%\tmp.txt
; assuming the above has been done somewhere

;read file's data into memory buffer
f := fileOpen( A_ScriptDir "\sample.dat", "r", "CP0" )
bufSize := f.RawRead( buffer, f.Length )
f.close()

encoding = "UTF-8" ;specify a needed encoding here
if sLen := Crypt.Encrypt._Encrypt( buffer,bufSize, "mypassword", 0,0,0,7,6 )
{
  if ( encoding  = "utf-16" || encoding = "cp1200" )
    sLen /= 2
  msgbox % strget(&buffer,sLen,encoding )
}   


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 6:34 am 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
my mistake, i didn't test it
change
Code:
encoding = "UTF-8"

to
Code:
encoding := "UTF-8"

_________________
Crypt|QMsgBox|PUM|Quick Cliq|WinClipboard


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2012, 6:52 am 
Oh, I also didn't notice it. Thanks. It works now.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group