Can MySQL (Windows) do SHA-256 and HMAC hashing?

Long time reader, first time poster. And I start with a rather mysterious one!

What I want to do is encrypt the string using the SHA-256 algorithm and hash it with the key.

I found that someone did an excellent job of creating an algorithm for โ€œnormalโ€ SHA-2 encryption as a stored function at: http://blog.darkrainfall.org/sha-256-in-mysql/ , which is probably will be useful to others, but I need to do this with a key.

Does anyone know if this is possible? I'm afraid I'm completely new to encryption.

I am using mySQL 5.1 on a Windows 2003 server.

Greetings.

+6
mysql encryption hash
source share
1 answer

It's not clear what your ultimate goal is, but the SHA implementation you referred to should be able to do the desired hash. One of the values โ€‹โ€‹of "hashing something with a key" for message authentication may be that you take a secret key and add it to the data, and then hash the whole result. Useful Wikipedia has information on HMAC .

Note that hashing is not encryption. The question seems to imply that hashing is the same as encryption. A hash, however, takes some data and runs it through a data blender and creates (usually) a piece of data of a fixed length. With a cryptographically strong hash function, it is assumed that from a practical point of view it is impossible to get an input that leads to a given hash value. Encryption, on the other hand, takes a key and a piece of data and starts it through a data blender and creates a piece of data, which can then be โ€œunmixedโ€ in combination with the original key to obtain the source data.

+1
source share

All Articles