diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-16 19:46:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-16 19:46:48 +0000 |
commit | 311bcfc6b3acdd6fd152798c7f287ddf74fa2a98 (patch) | |
tree | 0ec307299b1dada3701e42f4ca6eda57d708261e /contrib/pgcrypto/expected/3des.out | |
parent | Initial commit. (diff) | |
download | postgresql-15-311bcfc6b3acdd6fd152798c7f287ddf74fa2a98.tar.xz postgresql-15-311bcfc6b3acdd6fd152798c7f287ddf74fa2a98.zip |
Adding upstream version 15.4.upstream/15.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/pgcrypto/expected/3des.out')
-rw-r--r-- | contrib/pgcrypto/expected/3des.out | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/contrib/pgcrypto/expected/3des.out b/contrib/pgcrypto/expected/3des.out new file mode 100644 index 0000000..ee15489 --- /dev/null +++ b/contrib/pgcrypto/expected/3des.out @@ -0,0 +1,65 @@ +-- +-- 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) + |