| Author |
Message |
Forum: Scripts Topic: AES Encrypt/Decrypt of A File in WXP or Higher |
| manonstreet |
|
Posted: September 8th, 2010, 1:57 am
|
|
Replies: 26 Views: 10844
|
Nevermind. It helps if you use the same randomly generated IV to decrypt, and not a new random IV.  |
|
 |
Forum: Scripts Topic: AES Encrypt/Decrypt of A File in WXP or Higher |
| manonstreet |
|
Posted: September 6th, 2010, 9:22 pm
|
|
Replies: 26 Views: 10844
|
| Sorry, I think I was wrong on CryptGenKey: It generates a session key\password and no IV. CryptSetKeyParam can be passed a pointer to an IV, which we can choose\create ourselfes. IV and key are two seperate things, both needed when not using the cipher in ECB mode. If not provided IV defaults to 0,... |
|
 |
Forum: Support Topic: hmac sha1 help |
| manonstreet |
|
Posted: September 5th, 2010, 3:06 am
|
|
Replies: 11 Views: 699
|
| Very nicely coded. I don't know what I was doing wrong before, buy you make it seem so simple :wink: . Thanks. It always seems simple after its implemented. Don't ask me why the algorithm ID in the KEYBLOB has to be set to RC2, because I haven't a clue. I think this mystery is why there are only qu... |
|
 |
Forum: Scripts Topic: Hash-based Message Authentication Code (HMAC) |
| manonstreet |
|
Posted: September 5th, 2010, 2:49 am
|
|
Replies: 0 Views: 538
|
| Maybe someone will find this useful. You can use the code to generate HMAC MD5 / SHA1 / SHA-256 / SHA-384 / SHA-512 digests. Key or data can be in string or hex format (using the helper MCode function). ; written by manonstreet - do with it what you like #NoEnv ; using two test vectors from http://t... |
|
 |
Forum: Support Topic: hmac sha1 help |
| manonstreet |
|
Posted: September 1st, 2010, 8:57 pm
|
|
Replies: 11 Views: 699
|
| I feel your pain... since I tried to do the same thing about 8 months ago. However, I never got the advapi32.dll functions to give a correct HMAC. As a workaround (and to improve portability of the apps that use it) I ported the hmac algorithm to native AHK. I'm interested to see what a working sol... |
|
 |
Forum: Support Topic: hmac sha1 help |
| manonstreet |
|
Posted: September 1st, 2010, 6:28 am
|
|
Replies: 11 Views: 699
|
| Thanks! I will try this out. BTW - I think I found the source of the problem. As your code shows, we should only be hashing the key if the key is larger than the block size (64). I believe that instead of doing an initial CryptCreateHash, CryptHashData, and CryptDeriveKey, that I should just be doin... |
|
 |
Forum: Support Topic: hmac sha1 help |
| manonstreet |
|
Posted: September 1st, 2010, 3:17 am
|
|
Replies: 11 Views: 699
|
| I'll keep at it. But in the interim, can you share you native hmac code? |
|
 |
Forum: Support Topic: hmac sha1 help |
| manonstreet |
|
Posted: August 31st, 2010, 2:49 pm
|
|
Replies: 11 Views: 699
|
| Good catch. The code no longer errors out. Only problem is, the returned hash is not correct :? data = mydata key = mykey hash := hmac_sha1(data, key) hash is now set to 26f3656e0d8c3958996e140471587a22eb3b1e57 But comparing this with perl perl -e "use Digest::HMAC_SHA1 qw(hmac_sha1... |
|
 |
Forum: Support Topic: hmac sha1 help |
| manonstreet |
|
Posted: August 30th, 2010, 3:24 pm
|
|
Replies: 11 Views: 699
|
| I'm trying to write an hmac sha1 routine and having some difficulty. I am using the following article as a reference for my implementation: http://msdn.microsoft.com/en-us/library/aa382379%28VS.85%29.aspx I am also using the MD5 thread ( http://www.autohotkey.com/forum/topic17853.html ) as an exampl... |
|
 |
| Sort by: |