📄 aes.out
字号:
ij> -------------------------------------------------------------------------------------- beetle6023 : support for AES encryption algorithm-- Top level testcases grp.-- Case 1.x different feedback modes (valid - CBC,ECB,OFB,unsupported - ABC)-- 2 cases for each - creating db and recovery mode-- Case 2.x padding ( unsupported padding )-- Case 3.x key lengths with bootpassword-- case of 128 bits, 192 bits and 256 bits and unsupported 512 bits-- mismatch keylengths (case of one keylength during creation and another -- during connecting)-- Case 4.x case of changing boot password ( covered by test - store/encryptDatabase.sql)-- Also see store/access.sql for other cases that are run with AES encryption-- Case 5.x give external encryptionKey instead of bootpassword-------------------------------------------------------------------------------------- 1.1.1 AES - CBC connect 'jdbc:derby:encdb;create=true;dataEncryption=true;encryptionAlgorithm=AES/CBC/NoPadding;bootPassword=Thursday';ij> autocommit off;ij> create table t1(i1 int);0 rows inserted/updated/deletedij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 row selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.1.2 AES - CBC, recoverconnect 'jdbc:derby:encdb;create=true;dataEncryption=true;encryptionAlgorithm=AES/CBC/NoPadding;bootPassword=Thursday';WARNING 01J01: Database 'encdb' not created, connection made to existing database instead.ij> autocommit off;ij> create table t1(i1 int);ERROR X0Y32: Table/View 'T1' already exists in Schema 'APP'.ij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 2 rows selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.2.1 AES - ECB connect 'jdbc:derby:encdb_ecb;create=true;dataEncryption=true;encryptionAlgorithm=AES/ECB/NoPadding;bootPassword=Thursday';ij> autocommit off;ij> create table t1(i1 int);0 rows inserted/updated/deletedij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 row selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.2.2 AES - ECB, recoverconnect 'jdbc:derby:encdb_ecb;create=true;dataEncryption=true;encryptionAlgorithm=AES/ECB/NoPadding;bootPassword=Thursday';WARNING 01J01: Database 'encdb_ecb' not created, connection made to existing database instead.ij> autocommit off;ij> create table t1(i1 int);ERROR X0Y32: Table/View 'T1' already exists in Schema 'APP'.ij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 2 rows selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.3.1 AES - OFB connect 'jdbc:derby:encdb_ofb;create=true;dataEncryption=true;encryptionAlgorithm=AES/OFB/NoPadding;bootPassword=Thursday';ij> autocommit off;ij> create table t1(i1 int);0 rows inserted/updated/deletedij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 row selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.3.2 AES - OFB, recoverconnect 'jdbc:derby:encdb_ofb;create=true;dataEncryption=true;encryptionAlgorithm=AES/OFB/NoPadding;bootPassword=Thursday';WARNING 01J01: Database 'encdb_ofb' not created, connection made to existing database instead.ij> autocommit off;ij> create table t1(i1 int);ERROR X0Y32: Table/View 'T1' already exists in Schema 'APP'.ij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 2 rows selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.4.1 AES - CFB connect 'jdbc:derby:encdb_cfb;create=true;dataEncryption=true;encryptionAlgorithm=AES/CFB/NoPadding;bootPassword=Thursday';ij> autocommit off;ij> create table t1(i1 int);0 rows inserted/updated/deletedij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 row selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.4.2 AES - CFB, recoverconnect 'jdbc:derby:encdb_cfb;create=true;dataEncryption=true;encryptionAlgorithm=AES/CFB/NoPadding;bootPassword=Thursday';WARNING 01J01: Database 'encdb_cfb' not created, connection made to existing database instead.ij> autocommit off;ij> create table t1(i1 int);ERROR X0Y32: Table/View 'T1' already exists in Schema 'APP'.ij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 2 rows selectedij> commit;ij> disconnect;ij> ------------------------------------- 1.5.1 -ve cases: AES - unsupported feedback modeconnect 'jdbc:derby:encdb_abc;create=true;dataEncryption=true;encryptionAlgorithm=AES/ABC/NoPadding;bootPassword=Thursday';ERROR XJ041: Failed to create database 'encdb_abc', see the next exception for details.ERROR XBM01: Startup failed due to an exception. See next exception for details. ERROR XBCXI: The feedback mode 'ABC' is not supported. Supported feedback modes are CBC, CFB, OFB and ECB.ij> autocommit off;IJ ERROR: Unable to establish connectionij> create table t1(i1 int);IJ ERROR: Unable to establish connectionij> insert into t1 values ( 1);IJ ERROR: Unable to establish connectionij> ------------------------------------- 2.1 -ve cases: AES - unsupported padding modeconnect 'jdbc:derby:encdb_pkcs5;create=true;dataEncryption=true;encryptionAlgorithm=AES/ECB/PKCS5Padding;bootPassword=Thursday';ERROR XJ041: Failed to create database 'encdb_pkcs5', see the next exception for details.ERROR XBM01: Startup failed due to an exception. See next exception for details. ERROR XBCXB: Bad encryption padding 'PKCS5Padding' or padding not specified. 'NoPadding' must be used.ij> autocommit off;IJ ERROR: Unable to establish connectionij> create table t1(i1 int);IJ ERROR: Unable to establish connectionij> insert into t1 values ( 1);IJ ERROR: Unable to establish connectionij> -------------------------------------- 3.x key lengths -- 128,192,256 and also unsupported key length-- 3.1 , 128 key lengthconnect 'jdbc:derby:encdbcbc_128;create=true;dataEncryption=true;encryptionKeyLength=128;encryptionAlgorithm=AES/CBC/NoPadding;bootPassword=Thursday';ij> autocommit off;ij> create table t1(i1 int);0 rows inserted/updated/deletedij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 row selectedij> commit;ij> disconnect;ij> connect 'jdbc:derby:encdbcbc_128;create=true;dataEncryption=true;encryptionKeyLength=128;encryptionAlgorithm=AES/CBC/NoPadding;bootPassword=Thursday';WARNING 01J01: Database 'encdbcbc_128' not created, connection made to existing database instead.ij> autocommit off;ij> create table t1(i1 int);ERROR X0Y32: Table/View 'T1' already exists in Schema 'APP'.ij> insert into t1 values ( 1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 2 rows selectedij> commit;ij> disconnect;ij> ------------------------------------------------------ 3.4 unsupported key lengthconnect 'jdbc:derby:encdbcbc_512;create=true;dataEncryption=true;encryptionKeyLength=512;encryptionAlgorithm=AES/CBC/NoPadding;bootPassword=Thursday';ERROR XJ041: Failed to create database 'encdbcbc_512', see the next exception for details.ERROR XBM01: Startup failed due to an exception. See next exception for details. ERROR XJ001: Java exception: 'Wrong keysize: must be equal to 128, 192 or 256: java.security.InvalidParameterException'.ij> autocommit off;IJ ERROR: Unable to establish connectionij> create table t1(i1 int);IJ ERROR: Unable to establish connectionij> insert into t1 values ( 1);IJ ERROR: Unable to establish connectionij> select * from t1;IJ ERROR: Unable to establish connectionij> commit;IJ ERROR: Unable to establish connectionij> disconnect;IJ ERROR: Unable to establish connectionij> ---------------------------------------------------- 5.1 give external encryptionKey instead of bootpasswordconnect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=AES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';ij> create table t1(i1 int);0 rows inserted/updated/deletedij> insert into t1 values(1);1 row inserted/updated/deletedij> select * from t1;I1 -----------1 1 row selectedij> commit;ij> disconnect;ij> connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=AES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';WARNING 01J01: Database 'encdbcbc_key' not created, connection made to existing database instead.ij> select * from t1;I1 -----------1 1 row selectedij>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -