DemonForce
asked on
SHA-256 HASH FOR EXCEL
Hi,
I need to protect a sheet of passwords using SHA-256 Hashing, I have working macro scripts for MD5 and SHA-1, I would like to implement SHA-256 but can not find any macro code to achieve this.
I need to protect a sheet of passwords using SHA-256 Hashing, I have working macro scripts for MD5 and SHA-1, I would like to implement SHA-256 but can not find any macro code to achieve this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ah, so you're using it in a formula. Add this to a regular module:
In a formula:
Public Function SHA256Hash(strInput As String)
Dim oSHA256 As CSHA256
Set oSHA256 = New CSHA256
SHA256Hash = oSHA256.SHA256(strInput)
Set oSHA256 = Nothing
End Function
In a formula:
=SHA256Hash("Test")
or=SHA256Hash(A1)
ASKER
Perfect, thanx :)
ASKER
Thank you for that, I imported into Excel as a class module, and tried to call the function sha256, which shows #REF ?