| 1 |
-- |
| 2 |
-- DES cipher |
| 3 |
-- |
| 4 |
-- no official test vectors atm |
| 5 |
-- from blowfish.sql |
| 6 |
SELECT encrypt('\x0123456789abcdef', '\xfedcba9876543210', 'des-ecb/pad:none'); |
| 7 |
ERROR: encrypt error: Cipher cannot be initialized |
| 8 |
-- empty data |
| 9 |
select encrypt('', 'foo', 'des'); |
| 10 |
ERROR: encrypt error: Cipher cannot be initialized |
| 11 |
-- 8 bytes key |
| 12 |
select encrypt('foo', '01234589', 'des'); |
| 13 |
ERROR: encrypt error: Cipher cannot be initialized |
| 14 |
-- decrypt |
| 15 |
select encode(decrypt(encrypt('foo', '0123456', 'des'), '0123456', 'des'), 'escape'); |
| 16 |
ERROR: encrypt error: Cipher cannot be initialized |
| 17 |
-- iv |
| 18 |
select encrypt_iv('foo', '0123456', 'abcd', 'des'); |
| 19 |
ERROR: encrypt_iv error: Cipher cannot be initialized |
| 20 |
select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', 'des'), 'escape'); |
| 21 |
ERROR: decrypt_iv error: Cipher cannot be initialized |
| 22 |
-- long message |
| 23 |
select encrypt('Lets try a longer message.', '01234567', 'des'); |
| 24 |
ERROR: encrypt error: Cipher cannot be initialized |
| 25 |
select encode(decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des'), 'escape'); |
| 26 |
ERROR: encrypt error: Cipher cannot be initialized |