2005-03-21 08:24:52 +03:00
|
|
|
--
|
|
|
|
-- DES cipher
|
|
|
|
--
|
|
|
|
|
|
|
|
-- no official test vectors atm
|
|
|
|
|
|
|
|
-- from blowfish.sql
|
2021-12-08 08:01:35 +03:00
|
|
|
SELECT encrypt('\x0123456789abcdef', '\xfedcba9876543210', 'des-ecb/pad:none');
|
2005-03-21 08:24:52 +03:00
|
|
|
|
|
|
|
-- empty data
|
2021-12-08 08:01:35 +03:00
|
|
|
select encrypt('', 'foo', 'des');
|
2005-03-21 08:24:52 +03:00
|
|
|
-- 8 bytes key
|
2021-12-08 08:01:35 +03:00
|
|
|
select encrypt('foo', '01234589', 'des');
|
2005-03-21 08:24:52 +03:00
|
|
|
|
|
|
|
-- decrypt
|
2021-12-08 08:01:35 +03:00
|
|
|
select encode(decrypt(encrypt('foo', '0123456', 'des'), '0123456', 'des'), 'escape');
|
2005-03-21 08:24:52 +03:00
|
|
|
|
|
|
|
-- iv
|
2021-12-08 08:01:35 +03:00
|
|
|
select encrypt_iv('foo', '0123456', 'abcd', 'des');
|
|
|
|
select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', 'des'), 'escape');
|
2005-03-21 08:24:52 +03:00
|
|
|
|
2005-07-13 00:27:45 +04:00
|
|
|
-- long message
|
2021-12-08 08:01:35 +03:00
|
|
|
select encrypt('Lets try a longer message.', '01234567', 'des');
|
|
|
|
select encode(decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des'), 'escape');
|