RE: <<A web search for "sqlserver hmac sha1" showed a few approaches.>>

Fair enough.  I will do some testing and report back to the GPC.

The following looked worth a first area of investigation:

<<

DECLARE @HashThis nvarchar(4000);
SELECT @HashThis = CONVERT(nvarchar(4000),'dslfdkjLK85kldhnv$n000#knf');
SELECT HASHBYTES('SHA1', @HashThis);

>>

https://www.sqlservercentral.com/Forums/Topic1376183-391-1.aspx

On the good side, I have both Oracle and MS-SQL available at the moment,
so I can directly compare an Oracle result to an MS-SQL result.

Jay Pedersen, M.A.
Department of Pathology/Microbiology
University of Nebraska Medical Center
985900 Nebraska Medical Center
Omaha NE  68198-5900
402-559-9487<tel:402-559-9593> (office)
402-739-3496<tel:402-350-7851> (mobile)
________________________________
From: Dan Connolly <dconno...@kumc.edu>
Sent: Friday, March 1, 2019 9:26 AM
To: Pedersen, Jay G
Cc: gpc-dev@listserv.kumc.edu
Subject: Re: MS-SQL hashing function?, re: Death index file

Non-UNMC email



A web search for "sqlserver hmac sha1" showed a few approaches. I'm not 
familiar enough with sqlserver to know which ones are likely to work well.


On Mar 1, 2019 6:47 AM, "Pedersen, Jay G" <jay.peder...@unmc.edu> wrote:
Hi,

I am wondering if anyone knows if it is possible
to create a MS-SQL analog of the following
Oracle function ... which provides hasing
of SSN and DOB:

I am hoping Dan Connolly might be able to provide direction.
The fallback is to create a python script to
interface to MS-SQL and create hashed versions of
DOB and SSN.

Oracle code:

"""

create function dmf.keyed_hash(data varchar2, hash_key varchar2) return varchar2
is
begin
return
 DBMS_CRYPTO.mac(
   UTL_I18N.string_to_raw(data, 'AL32UTF8'),
   DBMS_CRYPTO.hmac_sh1,
   UTL_I18N.string_to_raw(hash_key, 'AL32UTF8'))
end

"""


Jay Pedersen, M.A.
Department of Pathology/Microbiology
University of Nebraska Medical Center
985900 Nebraska Medical Center
Omaha NE  68198-5900
402-559-9487<tel:402-559-9593> (office)
402-739-3496<tel:402-350-7851> (mobile)

The information in this e-mail may be privileged and confidential, intended 
only for the use of the addressee(s) above. Any unauthorized use or disclosure 
of this information is prohibited. If you have received this e-mail by mistake, 
please delete it and immediately contact the sender.

The information in this e-mail may be privileged and confidential, intended 
only for the use of the addressee(s) above. Any unauthorized use or disclosure 
of this information is prohibited. If you have received this e-mail by mistake, 
please delete it and immediately contact the sender.
_______________________________________________
Gpc-dev mailing list
Gpc-dev@listserv.kumc.edu
http://listserv.kumc.edu/mailman/listinfo/gpc-dev

Reply via email to