SHA-2 UDFs for Teradata

Extensibility
Enthusiast

SHA-2 UDFs for Teradata

Hi all,

I just released SHA-2 UDFs (SHA-256/512) to GitHub.

https://github.com/akuroda/teradata-udf-sha2

Enjoy!

-- Akira Kuroda

Tags (3)
9 REPLIES
Enthusiast

Re: SHA-2 UDFs for Teradata

Very good. Keep sharing your ideas.

Cheers,

Raja

Teradata Employee

Re: SHA-2 UDFs for Teradata

Does it can support unicdoe?

Victor

Enthusiast

Re: SHA-2 UDFs for Teradata

Hi Victor,

No Unicode support for now.  Do you have any ideas about those issues below?

- I'm not sure about the use case. Could you tell me how you are going to use?

- We need a separate function name as Teradata doesn't allow overloading Latin and Unicode UDFs. I'm not sure what the appropreiate name for that function... hash_sha256u()?

- In Teradata, the Unicode character is not stored as UTF-8 or UTF-16. That may cause some confusion if we compared the hash value generated by other programs.

Regards,

-- Akira Kuroda

Re: SHA-2 UDFs for Teradata

Using http://downloads.teradata.com/download/tools/unicode-tool-kit

session character set utf8

sel hash_sha1(udf_utf16to8('Москва'))

result is the same as in Oracle - just found for ourself issue :)

--

Regards, Alexander

Enthusiast

Re: SHA-2 UDFs for Teradata

Thanks Alexander,

I tried Unicode Took Kit and seems fine. I added FAQ to the GitHub's wiki. See https://github.com/akuroda/teradata-udf-sha2/wiki

Regards,

-- Akira

Enthusiast

Re: SHA-2 UDFs for Teradata

Hi All,

An old thread but was hoping to get some input as to whether it's safe to run these UDFs in unprotected mode?  I've tested them a fair bit in protected  mode and they run fine.  Has anyone experience any reboots/issues when running in Unprotected mode?

thanks in advance.

Teradata Employee

Re: SHA-2 UDFs for Teradata

Hello, one of our Teradata customers asked for these functions. I downloaded a compiled them. Both functions works!! Thank you very much. Jiri Novotny Teradata DBA

New Member

Re: SHA-2 UDFs for Teradata

HI Akira, please i made the ash sh256 and all is ok, but i need revert the hash, for example:

for the column: numer:

 

     421813034567

 

The result es the following:

SELECT HASH_SHA256(NUMBER)

 

a609e369f6fad09df71afb0cfd52d7c85c187d6d5c5276bca6d0ad03ee779291 

 

All is OK!!!

 

Now, i need do the hash in reverse and get the original number: 421813034567

Please your help

 

Thank's

Antonio

 

 

 

 

Junior Contributor

Re: SHA-2 UDFs for Teradata

SHA2 is a Crytographic Hash Function and thus designed to be non-invertible :-)

 

If you want to encrypt data you need something like an AES UDF or software like Protegrity