Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Hash-ish GUI - CRC32 / MD5 / SHA1


  • Please log in to reply
11 replies to this topic
SKAN
  • Administrators
  • 9114 posts
  • Last active:
  • Joined: 26 Dec 2005
A simple GUI script that generates/displays CRC32/MD5/SHA1 hash for file or string ( strings are auto-converted to UTF-8 ).


For strings you may type or copy/paste unicode strings into text box

Posted Image

For file hash, you may use the button provided, or drag-drop a file onto the
GUI or the script... or you could place it in SENDTO folder and access it from
Windows Explorer's context menu.

Posted Image


View as HTM | Download


MasterFocus
  • Moderators
  • 4322 posts
  • Last active:
  • Joined: 08 Apr 2009
Hashish GUI? hahaha :lol:
Jokes aside, nice work!

[1] The "Download" link is broken (but not the "View as HTM" one).
[2] I see QPX() is required, right?

SKAN
  • Administrators
  • 9114 posts
  • Last active:
  • Joined: 26 Dec 2005

Hashish GUI? hahaha :lol:
Jokes aside, nice work!


:D
Thanks!


[1] The "Download" link is broken (but not the "View as HTM" one).


Sync problem! It works now.

[2] I see QPX() is required, right?


Jeez!.. Thanks. Inserted it now.

njciancio
  • Members
  • 141 posts
  • Last active: Sep 14 2014 06:31 PM
  • Joined: 31 May 2012

Love it!

SKAN: Good grief! Will you ever stop providing the most useful tools? You're a heavyweight!



Wicked
  • Members
  • 504 posts
  • Last active: Jun 14 2014 06:04 PM
  • Joined: 07 Jun 2008
Incredibly useful! Thank-you once again from the AHK community, SKAN!

kiwijunglist
  • Members
  • 61 posts
  • Last active: Aug 14 2013 05:56 AM
  • Joined: 26 May 2009

Hi

 

I'm new to AHK (2wks) and I'm trying to generate md5 hash.  I was unable to get a snipped from the code to use

 

I just basically want

 

Str := "This is a string"

 

Msgbox % Str " -> " MD5(Str)

 

EDIT: Found some code that works

 

Keywords = MD5, String, API, Hash, Convert

 
Str := "This is a string"
 
msgbox % MD5(Str)
 
; code
 
HashFromAddr(pData, len, algid, key=0)
{
  hProv := size := hHash := hash := ""
  ptr := (A_PtrSize) ? "ptr" : "uint"
  aw := (A_IsUnicode) ? "W" : "A"
  if (DllCall("advapi32\CryptAcquireContext" aw, ptr "*", hProv, ptr, 0, ptr, 0, "uint", 1, "uint", 0xF0000000))
  {
    if (DllCall("advapi32\CryptCreateHash", ptr, hProv, "uint", algid, "uint", key, "uint", 0, ptr "*", hHash))
    {
      if (DllCall("advapi32\CryptHashData", ptr, hHash, ptr, pData, "uint", len, "uint", 0))
      {
        if (DllCall("advapi32\CryptGetHashParam", ptr, hHash, "uint", 2, ptr, 0, "uint*", size, "uint", 0))
        {
          VarSetCapacity(bhash, size, 0)
          DllCall("advapi32\CryptGetHashParam", ptr, hHash, "uint", 2, ptr, &bhash, "uint*", size, "uint", 0)
        }
      }
      DllCall("advapi32\CryptDestroyHash", ptr, hHash)
    }
    DllCall("advapi32\CryptReleaseContext", ptr, hProv, "uint", 0)
  }
  int := A_FormatInteger
  SetFormat, Integer, h
  Loop, % size
  {
    v := substr(NumGet(bhash, A_Index-1, "uchar") "", 3)
    while (strlen(v)<2)
      v := "0" v
    hash .= v
  }
  SetFormat, Integer, % int
  return hash
}
 
 
HashFromString(string, algid, key=0)
{
  len := strlen(string)
  if (A_IsUnicode)
  {
    VarSetCapacity(data, len)
    StrPut := "StrPut"
    %StrPut%(string, &data, len, "cp0")
    return HashFromAddr(&data, len, algid, key)
  }
  data := string
  return HashFromAddr(&data, len, algid, key)
}
 
MD5(string)
{
  return HashFromString(string, 0x8003)
}


wzxiaodu
  • Members
  • 4 posts
  • Last active: Dec 11 2013 03:56 PM
  • Joined: 30 Nov 2012

this links is error!

cant download !



jNizM
  • Members
  • 751 posts
  • Last active: Today, 02:18 PM
  • Joined: 01 Aug 2012
link worked!

Klark92
  • Members
  • 869 posts
  • Last active: Oct 29 2014 03:59 AM
  • Joined: 19 Feb 2012

Can somebody upload this link again ? its dead



joedf
  • Members
  • 799 posts
  • Last active: Today, 11:33 AM
  • Joined: 20 May 2012
here you go! http://ge.tt/8zMaRUW1/v/3 ;)

Klark92
  • Members
  • 869 posts
  • Last active: Oct 29 2014 03:59 AM
  • Joined: 19 Feb 2012

thank you ! :)



joedf
  • Members
  • 799 posts
  • Last active: Today, 11:33 AM
  • Joined: 20 May 2012
No problemo!