Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Using SHA2

OdDjObOdDjOb Member Posts: 13
Hi there,

I need to store information in my SQL 2005 DB, but my field that I'm using, must be encrypted using the SHA2 algorithm to comply with certain regulations. Where can I find this algorithm to use or is there any built in system functions that I can use? I've already tried using "hashbytes" with SHA & SHA1 as parameters, but they return duplicates values when running it on a big enough scale.

Thanks in advance.

Comments

  • JonathanJonathan Member Posts: 2,914
    Hi,

    I've been using SHA-256, and I do the hashing in the software before sending the value to the database. If you are working with .Net, there are some classes to do this - just search for .Net and SHA-2 and you should find something.

    : I've already tried using "hashbytes" with SHA & SHA1 as parameters, but
    : they return duplicates values when running it on a big enough scale.
    :
    Well, any hash function, SHA-2 as well, can return the same value for two different strings. That isn't one of the characteristics of a secure hash function, so if you're relying on every different string hashing to a completely unique value then you're going to run into problems with pretty much any of the secure hashing algorithms.

    Jonathan
    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
  • OdDjObOdDjOb Member Posts: 13
    Hi,
    As a last resort, we can compile a dll to be used in SQL for this purpose, but we are trying to keep everything DB driven. The DB is read to generate the appropriate interface. We are using delphi win32. So, for us, this is not and option. Thanks for the suggestion. (",)
Sign In or Register to comment.