https://github.com/paranoiq/mysql-sha2
SHA2 implementation in pure PL/MySQL
https://github.com/paranoiq/mysql-sha2
Last synced: 7 months ago
JSON representation
SHA2 implementation in pure PL/MySQL
- Host: GitHub
- URL: https://github.com/paranoiq/mysql-sha2
- Owner: paranoiq
- License: other
- Created: 2010-04-16T09:07:58.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2011-01-06T12:00:10.000Z (about 15 years ago)
- Last Synced: 2025-06-28T03:12:43.367Z (7 months ago)
- Homepage:
- Size: 173 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.txt
- License: license.txt
Awesome Lists containing this project
README
Implementation of SHA2 hashing functions and related HMAC functions in PL/MySQL
Author: Vlasta Neubauer [paranoiq@centrum.cz]
License and warranty:
---------------------
This software is not licensed. Consider it as public domain. Use it as you like.
The author is not responsible for any damage caused by using this software.
Warning:
--------
These SHA2 functions in pure PL/MySQL are very slow. Using them in a time
critical job or using them to process large amount of data is not advised.
Example usage:
--------------
SELECT SHA2(512, 'message to hash');
SELECT HMAC_SHA2(512, 'message to sign', 'key');
First atribute of SHA2 and HMAC_SHA2 functions is the algorythm bit length.
Valid values are integers: 224, 256, 384 and 512
Content:
--------
SHA2.sql:
- wrapper function for hashing SHA2(algorythm, message)
HMAC_SHA2.sql:
- message authentication function HMAC_SHA2(algorythm, message, key)
- helper function STRING_XOR
SHA256A.sql:
- function SHA256A implementing SHA-256 and SHA-224 algorythms
- helper functions ARRAY_GET_INT and ROR_INT
SHA512A.sql:
- function SHA512A implementing SHA-512 and SHA-384 algorythms
- helper functions ARRAY_GET_BIGINT and ROR_BIGINT
SHA256A.test.sql:
SHA512A.test.sql:
HMAC_SHA2.test.sql:
- testing vectors. simply run this as SQL code. all queries should return 1
Enjoy!