postgresql/contrib/pgcrypto/expected/3des.out

66 lines
1.5 KiB
Plaintext

--
-- 3DES cipher
--
-- test vector from somewhere
SELECT encrypt('\x8000000000000000',
'\x010101010101010101010101010101010101010101010101',
'3des-ecb/pad:none');
encrypt
--------------------
\x95f8a5e5dd31d900
(1 row)
select encrypt('', 'foo', '3des');
encrypt
--------------------
\x752111e37a2d7ac3
(1 row)
-- 10 bytes key
select encrypt('foo', '0123456789', '3des');
encrypt
--------------------
\xd2fb8baa1717cb02
(1 row)
-- 22 bytes key
select encrypt('foo', '0123456789012345678901', '3des');
encrypt
--------------------
\xa44360e699269817
(1 row)
-- decrypt
select encode(decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des'), 'escape');
encode
--------
foo
(1 row)
-- iv
select encrypt_iv('foo', '0123456', 'abcd', '3des');
encrypt_iv
--------------------
\x50735067b073bb93
(1 row)
select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', '3des'), 'escape');
encode
--------
foo
(1 row)
-- long message
select encrypt('Lets try a longer message.', '0123456789012345678901', '3des');
encrypt
--------------------------------------------------------------------
\xb71e3422269d0ded19468f33d65cd663c28e0871984792a7b3ba0ddcecec8d2c
(1 row)
select encode(decrypt(encrypt('Lets try a longer message.', '0123456789012345678901', '3des'), '0123456789012345678901', '3des'), 'escape');
encode
----------------------------
Lets try a longer message.
(1 row)