2001-10-02 00:12:23 +08:00
|
|
|
--
|
2019-05-28 18:33:30 +08:00
|
|
|
-- HMAC-SHA1
|
2001-10-02 00:12:23 +08:00
|
|
|
--
|
|
|
|
|
2002-10-19 02:41:22 +08:00
|
|
|
SELECT encode(hmac(
|
2001-10-02 00:12:23 +08:00
|
|
|
'Hi There',
|
|
|
|
decode('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b', 'hex'),
|
|
|
|
'sha1'), 'hex');
|
|
|
|
|
|
|
|
-- 2
|
2002-10-19 02:41:22 +08:00
|
|
|
SELECT encode(hmac(
|
2001-10-02 00:12:23 +08:00
|
|
|
'Jefe',
|
|
|
|
'what do ya want for nothing?',
|
|
|
|
'sha1'), 'hex');
|
|
|
|
|
|
|
|
-- 3
|
2002-10-19 02:41:22 +08:00
|
|
|
SELECT encode(hmac(
|
2001-10-02 00:12:23 +08:00
|
|
|
decode('dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd', 'hex'),
|
|
|
|
decode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'),
|
|
|
|
'sha1'), 'hex');
|
|
|
|
|
|
|
|
-- 4
|
2002-10-19 02:41:22 +08:00
|
|
|
SELECT encode(hmac(
|
2001-10-02 00:12:23 +08:00
|
|
|
decode('cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd', 'hex'),
|
|
|
|
decode('0102030405060708090a0b0c0d0e0f10111213141516171819', 'hex'),
|
|
|
|
'sha1'), 'hex');
|
|
|
|
|
|
|
|
-- 5
|
2002-10-19 02:41:22 +08:00
|
|
|
SELECT encode(hmac(
|
2001-10-02 00:12:23 +08:00
|
|
|
'Test With Truncation',
|
|
|
|
decode('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c', 'hex'),
|
|
|
|
'sha1'), 'hex');
|
|
|
|
|
|
|
|
-- 6
|
2002-10-19 02:41:22 +08:00
|
|
|
SELECT encode(hmac(
|
2001-10-02 00:12:23 +08:00
|
|
|
'Test Using Larger Than Block-Size Key - Hash Key First',
|
|
|
|
decode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'),
|
|
|
|
'sha1'), 'hex');
|
|
|
|
|
|
|
|
-- 7
|
2002-10-19 02:41:22 +08:00
|
|
|
SELECT encode(hmac(
|
2001-10-02 00:12:23 +08:00
|
|
|
'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data',
|
|
|
|
decode('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'),
|
|
|
|
'sha1'), 'hex');
|