File: des_1.out

package info (click to toggle)
postgresql-15 15.13-0%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 166,512 kB
  • sloc: ansic: 899,752; sql: 109,423; perl: 42,533; yacc: 36,866; xml: 31,046; lex: 8,906; makefile: 6,175; sh: 4,842; cpp: 1,105; python: 151; asm: 65; sed: 16
file content (26 lines) | stat: -rw-r--r-- 1,112 bytes parent folder | download | duplicates (6)
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
--
-- DES cipher
--
-- no official test vectors atm
-- from blowfish.sql
SELECT encrypt('\x0123456789abcdef', '\xfedcba9876543210', 'des-ecb/pad:none');
ERROR:  encrypt error: Cipher cannot be initialized
-- empty data
select encrypt('', 'foo', 'des');
ERROR:  encrypt error: Cipher cannot be initialized
-- 8 bytes key
select encrypt('foo', '01234589', 'des');
ERROR:  encrypt error: Cipher cannot be initialized
-- decrypt
select encode(decrypt(encrypt('foo', '0123456', 'des'), '0123456', 'des'), 'escape');
ERROR:  encrypt error: Cipher cannot be initialized
-- iv
select encrypt_iv('foo', '0123456', 'abcd', 'des');
ERROR:  encrypt_iv error: Cipher cannot be initialized
select encode(decrypt_iv('\x50735067b073bb93', '0123456', 'abcd', 'des'), 'escape');
ERROR:  decrypt_iv error: Cipher cannot be initialized
-- long message
select encrypt('Lets try a longer message.', '01234567', 'des');
ERROR:  encrypt error: Cipher cannot be initialized
select encode(decrypt(encrypt('Lets try a longer message.', '01234567', 'des'), '01234567', 'des'), 'escape');
ERROR:  encrypt error: Cipher cannot be initialized