2 -- AES / Rijndael-128 cipher
4 -- some standard Rijndael testvalues
6 decode('00112233445566778899aabbccddeeff', 'hex'),
7 decode('000102030405060708090a0b0c0d0e0f', 'hex'),
8 'aes-ecb/pad:none'), 'hex');
10 ----------------------------------
11 69c4e0d86a7b0430d8cdb78070b4c55a
14 SELECT encode(encrypt(
15 decode('00112233445566778899aabbccddeeff', 'hex'),
16 decode('000102030405060708090a0b0c0d0e0f1011121314151617', 'hex'),
17 'aes-ecb/pad:none'), 'hex');
19 ----------------------------------
20 dda97ca4864cdfe06eaf70a0ec0d7191
23 SELECT encode(encrypt(
24 decode('00112233445566778899aabbccddeeff', 'hex'),
25 decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f', 'hex'),
26 'aes-ecb/pad:none'), 'hex');
28 ----------------------------------
29 8ea2b7ca516745bfeafc49904b496089
33 SELECT encode(encrypt(
34 decode('00112233445566778899aabbccddeeff', 'hex'),
35 decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f', 'hex'),
36 'aes-cbc/pad:none'), 'hex');
38 ----------------------------------
39 8ea2b7ca516745bfeafc49904b496089
43 SELECT encode(encrypt(
44 decode('0011223344', 'hex'),
45 decode('000102030405', 'hex'),
48 ----------------------------------
49 189a28932213f017b246678dbc28655f
52 SELECT encode(encrypt(
53 decode('0011223344', 'hex'),
54 decode('000102030405060708090a0b0c0d0e0f10111213', 'hex'),
57 ----------------------------------
58 3b02279162d15580e069d3a71407a556
61 SELECT encode(encrypt(
62 decode('0011223344', 'hex'),
63 decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b', 'hex'),
66 ----------------------------------
67 4facb6a041d53e0a5a73289170901fe7
71 select encode( encrypt('', 'foo', 'aes'), 'hex');
73 ----------------------------------
74 b48cc3338a2eb293b6007ef72c360d48
78 select encode( encrypt('foo', '0123456789', 'aes'), 'hex');
80 ----------------------------------
81 f397f03d2819b7172b68d0706fda4693
85 select encode( encrypt('foo', '0123456789012345678901', 'aes'), 'hex');
87 ----------------------------------
88 5c9db77af02b4678117bcd8a71ae7f53
92 select decrypt(encrypt('foo', '0123456', 'aes'), '0123456', 'aes');
99 select encode(encrypt_iv('foo', '0123456', 'abcd', 'aes'), 'hex');
101 ----------------------------------
102 2c24cb7da91d6d5699801268b0f5adad
105 select decrypt_iv(decode('2c24cb7da91d6d5699801268b0f5adad', 'hex'),
106 '0123456', 'abcd', 'aes');
113 select encode(encrypt('Lets try a longer message.', '0123456789', 'aes'), 'hex');
115 ------------------------------------------------------------------
116 d9beb785dd5403ed02f66b755bb191b93ed93ca54930153f2c3b9ec7785056ad
119 select decrypt(encrypt('Lets try a longer message.', '0123456789', 'aes'), '0123456789', 'aes');
121 ----------------------------
122 Lets try a longer message.