Transparent Data Encryption (TDE) was introduced in Oracle 10G Release 2. Tablespace encryption helps you to secure the complete contents of one Tablespace instead of encrypt column by column. Oracle has also built in support for hardware-based crypto accelaration 11.2.0.2 for Intel XEON 5600 CPUs with AES-NI. Keep in mind that TDE can also be a performance impact if you encrypt your data and have for example unencrypted indexes. In this case a FULL TABLE SCAN can occur.
We must complete three steps to encrypt our data.
Create a Wallet
Create a Tablespace
Test the encryption
License:
TDE is a part of the Oracle Advanced Security Option which also includes Strong Authentication and Network encryption. It is only avaible in the Enterprise Edtion of the database as extra cost option.
Create a Wallet:
Berfore we can create a encrypted tablespace we must first create a Oracle Wallet which holds the encryption key. The database read the sqlnet.ora File to find the wallet. If no entry is present in the sqlnet.ora File the database trys to find the Wallet under $ORACLE_HOME/admin/$ORACLE_SID/wallet.
SQL> select * from v$encryption_wallet;
WRL_ WRL_PARAMETER STATUS
---- ------------------------------ ------------------
file /etc/ORACLE/wallet/ OPEN
SQL> ALTER SYSTEM SET ENCRYPTION WALLET CLOSE;
ALTER SYSTEM SET ENCRYPTION WALLET CLOSE
*
ERROR at line 1:
ORA-28390: auto login wallet not open but encryption wallet may be open
SQL> ALTER SYSTEM SET ENCRYPTION WALLET CLOSE IDENTIFIED BY "welcome1";
System altered.
ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "welcome1";
CREATE TABLESPACE lobts3
DATAFILE '/u01/app/oracle/oradata/orcl/lobtbs3.dbf' SIZE 20M
AUTOEXTEND ON NEXT 64K
ENCRYPTION USING 'AES256'
DEFAULT STORAGE(ENCRYPT);
ALTER USER hr QUOTA UNLIMITED ON lobts3;
SQL> SELECT tablespace_name, encrypted FROM dba_tablespaces where tablespace_name = 'LOBTS3';
TABLESPACE_NAME ENC
------------------------------ ---
LOBTS3 YES
CONN hr/hr
CREATE TABLE bigemp (
empno NUMBER(10),
ename VARCHAR2(50)
)
TABLESPACE lobts3;
CREATE INDEX bigemp_test_idx ON bigemp(ename) TABLESPACE lobts3;
INSERT INTO bigemp (empno, ename) VALUES (10, 'This is secret data');
COMMIT;
SQL> select * from hr.bigemp;
select * from hr.bigemp
*
ERROR at line 1:
ORA-28365: wallet is not open