5
-- test vectors from RFC2144
9
decode('01 23 45 67 89 AB CD EF', 'hex'),
10
decode('01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A', 'hex'),
11
'cast5-ecb/pad:none'), 'hex');
12
-- result: 23 8B 4F E5 84 7E 44 B2
15
SELECT encode(encrypt(
16
decode('01 23 45 67 89 AB CD EF', 'hex'),
17
decode('01 23 45 67 12 34 56 78 23 45', 'hex'),
18
'cast5-ecb/pad:none'), 'hex');
19
-- result: EB 6A 71 1A 2C 02 27 1B
22
SELECT encode(encrypt(
23
decode('01 23 45 67 89 AB CD EF', 'hex'),
24
decode('01 23 45 67 12', 'hex'),
25
'cast5-ecb/pad:none'), 'hex');
26
-- result: 7A C8 16 D1 6E 9B 30 2E
31
select encode( encrypt('', 'foo', 'cast5'), 'hex');
33
select encode( encrypt('foo', '0123456789', 'cast5'), 'hex');
36
select decrypt(encrypt('foo', '0123456', 'cast5'), '0123456', 'cast5');
39
select encode(encrypt_iv('foo', '0123456', 'abcd', 'cast5'), 'hex');
40
select decrypt_iv(decode('384a970695ce016a', 'hex'),
41
'0123456', 'abcd', 'cast5');
44
select encode(encrypt('Lets try a longer message.', '0123456789', 'cast5'), 'hex');
45
select decrypt(encrypt('Lets try a longer message.', '0123456789', 'cast5'), '0123456789', 'cast5');