File: 3des_1.out

package info (click to toggle)
postgresql-18 18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156,336 kB
  • sloc: ansic: 993,549; sql: 127,589; perl: 59,056; xml: 30,905; yacc: 21,023; lex: 9,000; makefile: 6,881; sh: 5,354; cpp: 988; python: 710; asm: 40; sed: 3
file content (29 lines) | stat: -rw-r--r-- 1,318 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--
-- 3DES cipher
--
-- test vector from somewhere
SELECT encrypt('\x8000000000000000',
               '\x010101010101010101010101010101010101010101010101',
               '3des-ecb/pad:none');
ERROR:  encrypt error: Cipher cannot be initialized
select encrypt('', 'foo', '3des');
ERROR:  encrypt error: Cipher cannot be initialized
-- 10 bytes key
select encrypt('foo', '0123456789', '3des');
ERROR:  encrypt error: Cipher cannot be initialized
-- 22 bytes key
select encrypt('foo', '0123456789012345678901', '3des');
ERROR:  encrypt error: Cipher cannot be initialized
-- decrypt
select encode(decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des'), 'escape');
ERROR:  encrypt error: Cipher cannot be initialized
-- iv
select encrypt_iv('foo', '0123456', 'abcd', '3des');
ERROR:  encrypt_iv error: Cipher cannot be initialized
select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', '3des'), 'escape');
ERROR:  decrypt_iv error: Cipher cannot be initialized
-- long message
select encrypt('Lets try a longer message.', '0123456789012345678901', '3des');
ERROR:  encrypt error: Cipher cannot be initialized
select encode(decrypt(encrypt('Lets try a longer message.', '0123456789012345678901', '3des'), '0123456789012345678901', '3des'), 'escape');
ERROR:  encrypt error: Cipher cannot be initialized