Copy link to clipboard
Copied
I have a need to pass data to somebody and they have asked for it to be in SHA-1
Encryption is not my thing, and I'm trying to get my head around it. I've read the DOC's and the forum and can't quite figure this out
I read that SHA-1 is a hashing algorithm not an encryption, so I'm not sure if I should be using the GenerateSecretKey, it all got a little confusing
Let's say I have a MAC address 11:22:33:44:55:66
How would I convert that to a SHA-1
Can anybody point me in the right direction? I don't want/need to do anything too complex.
Thanks
Mark
Looks like I managed to answer my own question. I used the HASH instead of ENCRYPT.
Example
<CFSET newstring=hash('teststring',"SHA-1")>
Can anybody out there confirm that this is correct. I gave me a hased number, which I presume is SHA-1 so I think I'm set
Returned: B8473B86D4C2072CA9B08BD28E373E8253E865C4
Copy link to clipboard
Copied
Looks like I managed to answer my own question. I used the HASH instead of ENCRYPT.
Example
<CFSET newstring=hash('teststring',"SHA-1")>
Can anybody out there confirm that this is correct. I gave me a hased number, which I presume is SHA-1 so I think I'm set
Returned: B8473B86D4C2072CA9B08BD28E373E8253E865C4
Copy link to clipboard
Copied
That is correct. SHA-1 is a hash algorithm, not an encryption algorithm.
Copy link to clipboard
Copied
As I have managed to answer my own question I guess I should mark a CORRECT answer, the little bit of code I used above was what I needed