AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MD5
Goto page Previous  1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Thu Mar 29, 2007 9:32 pm    Post subject: Reply with quote

In my XP SP2 machine many cryptographic service providers are installed, but the relevant ones use the same rsaenh.dll:

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider\Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)" and
"..Base Cryptographic Provider v1.0" and
"..Strong Cryptographic Provider".

The base CSP in all Windows versions > 95 supports MD5 and SHA-1. On the other hand, the
"Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)" (Windows XP) and
"Microsoft Enhanced RSA and AES Cryptographic Provider" (Windows 2003)
provide support for the Advanced Encryption Standard cipher AES-128, AES-192 and AES-256, but AES is not supported on Windows NT, 2000 or 98.

Only the "Microsoft Enhanced RSA and AES Cryptographic Provider" on Windows 2003 supports the SHA-2 hash functions: SHA-256, SHA-384 and SHA-512. (See here.)

Anyway, for the enhanced CSP the right context selection is with type 24 (XP and 2003 only)
Code:
DllCall("advapi32\CryptAcquireContextA", UIntP,hProv, UInt,0
   , Str,"Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)", UInt,24, UInt,0)
Back to top
View user's profile Send private message
Seclinix



Joined: 25 Sep 2006
Posts: 160
Location: In a House, On my a55

PostPosted: Fri Mar 30, 2007 4:26 am    Post subject: Reply with quote

uhm just the version from the download centre ???
_________________
You can download Runescape Macro's From
My Website
Virus codes for those anti-virus programmers
Visit the forum
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Seclinix



Joined: 25 Sep 2006
Posts: 160
Location: In a House, On my a55

PostPosted: Fri Mar 30, 2007 4:33 am    Post subject: Reply with quote

Is there a way of getting a alogirth for a file to find its unique id?

example...

234io24oiu432kj424hjk23 = word
435khkjhkjh54k43h5j435 = excel
fjkhl 3jl4h2j4h23kl4h32j4 = virus
4jh32hj432hj4g234kjhg324 = BrutusAe2

i made up the hashes lol soz as you may tell hehe Laughing
_________________
You can download Runescape Macro's From
My Website
Virus codes for those anti-virus programmers
Visit the forum
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Fri Mar 30, 2007 1:24 pm    Post subject: Reply with quote

Seclinix wrote:
uhm just the version from the download centre ???
If you still get the error with AHK version 1.0.46.10 or later, make sure that there is nothing else in your script file, only the code posted above. When you see the error message window, press Ctrl-C to copy it to the clipboard, than paste it into your message and post it here.
Seclinix wrote:
alogirthm for a file to find its unique id
Which ID? The MD5 hash is often used to check the integrity of a downloaded file.
Back to top
View user's profile Send private message
Seclinix



Joined: 25 Sep 2006
Posts: 160
Location: In a House, On my a55

PostPosted: Fri Mar 30, 2007 8:53 pm    Post subject: Reply with quote

dc iopy and paste and not werk... philpho thought i could use an md5 hash thing to get the signature of a file as used by anti-virus software to identify it it wont look for the name cuz you can change it so i wants to be able to see the script of an exe or get a signature from it.
_________________
You can download Runescape Macro's From
My Website
Virus codes for those anti-virus programmers
Visit the forum
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Fri Mar 30, 2007 9:49 pm    Post subject: Reply with quote

I am not sure what you mean. If you want to find duplicate files, first sort the files by their size, and compute the hash (a CRC is sufficient) for the ones, which have equal sized pairs. External hash programs work, but if you want to use only Windows tools and AHK, read the files in variables and use Sean's script to call the Windows API hash. If the files are too large, you have to read them piece by piece (or use external hash programs).
Back to top
View user's profile Send private message
Seclinix



Joined: 25 Sep 2006
Posts: 160
Location: In a House, On my a55

PostPosted: Mon Apr 02, 2007 2:09 am    Post subject: Reply with quote

yes i want to read each program .exe in the actual script language instead of an encryption so i want to be able to use


fileread,

to get the entire script of the .exe file no matter how big it is
_________________
You can download Runescape Macro's From
My Website
Virus codes for those anti-virus programmers
Visit the forum
Back to top
View user's profile Send private message Send e-mail MSN Messenger
short



Joined: 18 Jan 2006
Posts: 28

PostPosted: Mon Apr 02, 2007 1:10 pm    Post subject: Reply with quote

Skan wrote:
Sean wrote:
Laszlo wrote:
I think the Windows built-in hash function can be different for different versions. Do you know, what Vista has? What is in Windows 98?

You're probably right, but I don't really know about them. It's only tested on my machine, XPSP2.


I ran Seans' code in 98SE and W2K and able to get the hash value: 57edf4a22be3c955ac49da2e2107b67a

It would be nice to know whether Seans' code runs in Vista.

Smile


Ran it in Vista
---------------------------
AutoHotkey.ahk
---------------------------
57edf4a22be3c955ac49da2e2107b67a
---------------------------
OK
---------------------------
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Mon Apr 02, 2007 1:30 pm    Post subject: Reply with quote

short wrote:
Ran it in Vista
---------------------------
AutoHotkey.ahk
---------------------------
57edf4a22be3c955ac49da2e2107b67a
---------------------------
OK
---------------------------


Thanks! Nice to know it.

@Sean: Thanks.. Very useful for me. I can finally discontinue using an external DLL for the task.

It would be nice if we can have an AHK FileGetHash command. It will supplement FileInstall command well.

Smile
Back to top
View user's profile Send private message Send e-mail
seclinix - offline
Guest





PostPosted: Fri Apr 06, 2007 11:44 pm    Post subject: Reply with quote

how do you get the hash from a file? you made examples from letters and sentences
Back to top
ahklerner



Joined: 26 Jun 2006
Posts: 1381
Location: USA

PostPosted: Fri Apr 06, 2007 11:51 pm    Post subject: Reply with quote

short wrote:
Skan wrote:
Sean wrote:
Laszlo wrote:
I think the Windows built-in hash function can be different for different versions. Do you know, what Vista has? What is in Windows 98?

You're probably right, but I don't really know about them. It's only tested on my machine, XPSP2.


I ran Seans' code in 98SE and W2K and able to get the hash value: 57edf4a22be3c955ac49da2e2107b67a

It would be nice to know whether Seans' code runs in Vista.

Smile


Ran it in Vista
---------------------------
AutoHotkey.ahk
---------------------------
57edf4a22be3c955ac49da2e2107b67a
---------------------------
OK
---------------------------


Same Here....Vista Home Premium

---------------------------
ahk.ahk
---------------------------
57edf4a22be3c955ac49da2e2107b67a
---------------------------
OK
---------------------------
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Sat Apr 07, 2007 12:06 am    Post subject: Reply with quote

seclinix - offline wrote:
how do you get the hash from a file? you made examples from letters and sentences
The simplest is "FileRead, OutputVar, Filename", and use OutputVar as the first parameter of the MD5 (or HASH) function.
Back to top
View user's profile Send private message
Seclinix



Joined: 25 Sep 2006
Posts: 160
Location: In a House, On my a55

PostPosted: Mon Apr 09, 2007 8:58 pm    Post subject: Reply with quote

i tried fileread and it came up with the a problem it said error and wouldnt tell me what... well it said error with the path to my file
i used fileread and it said.
error
specifically M:\ServU\Servu.exe
_________________
You can download Runescape Macro's From
My Website
Virus codes for those anti-virus programmers
Visit the forum
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Mon Apr 09, 2007 9:23 pm    Post subject: Reply with quote

It can be locked. It is enough to have an open explorer window, showing the file.
Back to top
View user's profile Send private message
Grumpy
Guest





PostPosted: Tue Apr 10, 2007 6:05 am    Post subject: Reply with quote

Laszlo wrote:
It is enough to have an open explorer window, showing the file.
I doubt so, otherwise nobody could work with Explorer...
Now, if the program is running, it is enough to lock the exe file, indeed.
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group