Rekeying
You can change (rekey) a master key and table keys. You cannot rekey tablespace keys.
Getting ready
It is assumed that a keystore is opened and a master key is created.
How to do it...
Connect to the database as a user who has administer key privilege or
SYSKM
privilege (for example,maja
):$ sqlplus maja
To rekey a table (for example, the
oe.customer
) using a different encryption algorithm (for example, AES128), execute the following statement:Figure 24 - Rekeying a table key
Change a master key by executing the following statement (in our example,
keystore_password
iswelcome1
):SQL> ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY keystore_password WITH BACKUP;
Figure 25 - Rekeying a master key
How it works...
When you changed a table key, in step 2, all encrypted data in the oe.customers table were decrypted and then encrypted using the new table key and the new encryption algorithm. If you just want to change key and use the same algorithm as before, syntax for rekeying is...