~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/sql/rijndael.sql

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- AES / Rijndael-128 cipher
 
3
--
 
4
 
 
5
-- some standard Rijndael testvalues
 
6
SELECT encode(encrypt(
 
7
decode('00112233445566778899aabbccddeeff', 'hex'),
 
8
decode('000102030405060708090a0b0c0d0e0f', 'hex'),
 
9
'aes-ecb/pad:none'), 'hex');
 
10
 
 
11
SELECT encode(encrypt(
 
12
decode('00112233445566778899aabbccddeeff', 'hex'),
 
13
decode('000102030405060708090a0b0c0d0e0f1011121314151617', 'hex'),
 
14
'aes-ecb/pad:none'), 'hex');
 
15
 
 
16
SELECT encode(encrypt(
 
17
decode('00112233445566778899aabbccddeeff', 'hex'),
 
18
decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f', 'hex'),
 
19
'aes-ecb/pad:none'), 'hex');
 
20
 
 
21
-- cbc
 
22
SELECT encode(encrypt(
 
23
decode('00112233445566778899aabbccddeeff', 'hex'),
 
24
decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f', 'hex'),
 
25
'aes-cbc/pad:none'), 'hex');
 
26
 
 
27
-- key padding
 
28
 
 
29
SELECT encode(encrypt(
 
30
decode('0011223344', 'hex'),
 
31
decode('000102030405', 'hex'),
 
32
'aes-cbc'), 'hex');
 
33
 
 
34
SELECT encode(encrypt(
 
35
decode('0011223344', 'hex'),
 
36
decode('000102030405060708090a0b0c0d0e0f10111213', 'hex'),
 
37
'aes-cbc'), 'hex');
 
38
 
 
39
SELECT encode(encrypt(
 
40
decode('0011223344', 'hex'),
 
41
decode('000102030405060708090a0b0c0d0e0f101112131415161718191a1b', 'hex'),
 
42
'aes-cbc'), 'hex');
 
43