Skip to main content
Inspiring
March 7, 2013
Answered

Create a SHA-1 value

  • March 7, 2013
  • 1 reply
  • 826 views

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

This topic has been closed for replies.
Correct answer ACS LLC

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

1 reply

ACS LLCAuthorCorrect answer
Inspiring
March 7, 2013

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

Legend
March 8, 2013

That is correct. SHA-1 is a hash algorithm, not an encryption algorithm.

ACS LLCAuthor
Inspiring
March 8, 2013

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