diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
commit | 6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch) | |
tree | 657d8194422a5daccecfd42d654b8a245ef7b4c8 /contrib/pgcrypto/expected/3des.out | |
parent | Initial commit. (diff) | |
download | postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.tar.xz postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.zip |
Adding upstream version 13.4.upstream/13.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 | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/contrib/pgcrypto/expected/3des.out b/contrib/pgcrypto/expected/3des.out new file mode 100644 index 0000000..8983a73 --- /dev/null +++ b/contrib/pgcrypto/expected/3des.out @@ -0,0 +1,71 @@ +-- +-- 3DES cipher +-- +-- ensure consistent test output regardless of the default bytea format +SET bytea_output TO escape; +-- test vector from somewhere +SELECT encode(encrypt( +decode('80 00 00 00 00 00 00 00', 'hex'), +decode('01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01', 'hex'), +'3des-ecb/pad:none'), 'hex'); + encode +------------------ + 95f8a5e5dd31d900 +(1 row) + +-- val 95 F8 A5 E5 DD 31 D9 00 +select encode( encrypt('', 'foo', '3des'), 'hex'); + encode +------------------ + 752111e37a2d7ac3 +(1 row) + +-- 10 bytes key +select encode( encrypt('foo', '0123456789', '3des'), 'hex'); + encode +------------------ + d2fb8baa1717cb02 +(1 row) + +-- 22 bytes key +select encode( encrypt('foo', '0123456789012345678901', '3des'), 'hex'); + encode +------------------ + a44360e699269817 +(1 row) + +-- decrypt +select decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des'); + decrypt +--------- + foo +(1 row) + +-- iv +select encode(encrypt_iv('foo', '0123456', 'abcd', '3des'), 'hex'); + encode +------------------ + 50735067b073bb93 +(1 row) + +select decrypt_iv(decode('50735067b073bb93', 'hex'), '0123456', 'abcd', '3des'); + decrypt_iv +------------ + foo +(1 row) + +-- long message +select encode(encrypt('Lets try a longer message.', '0123456789012345678901', '3des'), 'hex'); + encode +------------------------------------------------------------------ + b71e3422269d0ded19468f33d65cd663c28e0871984792a7b3ba0ddcecec8d2c +(1 row) + +select decrypt(encrypt('Lets try a longer message.', '0123456789012345678901', '3des'), '0123456789012345678901', '3des'); + decrypt +---------------------------- + Lets try a longer message. +(1 row) + |