Does your organization have the need to be PCI compliant? Does your organization handle sensitive patient data? Are you worried about losing sensitive data with lost backup tapes?
If the answer to some of these questions is yes, then you probably have the need to encrypt your data. This is a multi-blog entry covering Oracle database feature called Transparent Data Encryption or TDE. I will show some examples of TDE implementation in single instance Oracle databases as well as multi-instance RAC databases.
The innovative idea behind TDE is that it makes database encryption a very easy task, not involving any application changes to existing applications.
So here are the main steps in implementation of TDE:
1. Edit your sqlnet.ora to include entry for encryption wallet like this:
ENCRYPTION_WALLET_LOCATION=
(SOURCE=
(METHOD=FILE)
(METHOD_DATA=
(DIRECTORY= /oracle/product/11.1.0.6/db_1/network/admin/wallet)
)
)
(SOURCE=
(METHOD=FILE)
(METHOD_DATA=
(DIRECTORY= /oracle/product/11.1.0.6/db_1/network/admin/wallet)
)
)
3. Issue a command like: alter system set encryption key identified by "password"; Behind the scenes this command creates the encryption wallet and adds a TDE master key into the wallet.
4. That's basically it. Now it's possible to start defining encryption for your table columns. If we look at the wallet location we can see that there is a new file generated for our wallet:
$ pwd
5. Create table that holds encrypted data (or modify existing tables):
/oracle/product/11.1.0.6/db_1/network/admin/wallet
$ ls -ltr
total 4
-rw-r--r-- 1 oracle oinstall 1573 Apr 24 20:14 ewallet.p12
$ ls -ltr
total 4
-rw-r--r-- 1 oracle oinstall 1573 Apr 24 20:14 ewallet.p12
SQL> create table sample (x int, y varchar(2) encrypt);
Table created.
SQL> select * from dba_encrypted_columns;
OWNER TABLE_ COLUMN_NAME ENCRYPTION_ALG SAL
----- ------ ------------------------------ ----------------------------- ---
ANSSI SAMPLE Y AES 192 bits key YES
That's it. All the data that will enter column Y is to be encrypted using the default AES192 algorithm.
SQL> select * from dba_encrypted_columns;
OWNER TABLE_ COLUMN_NAME ENCRYPTION_ALG SAL
----- ------ ------------------------------ ----------------------------- ---
ANSSI SAMPLE Y AES 192 bits key YES