Hi All,
I am using DBMS_OBFUSCATION_TOOLKIT package for encrypting and decrypting the data.
For encryption OR decryption, we use a KEY on the basis of which data is encrypted or decrypted.
My problem is like this :
1. I set a key say 'aaaaaaaa'.
2. Now, all the records will be encrypted using that key and decryption is possible using this key only.
3. Later, I want to change the key.
So, I am decrypting all the records with the old key and then encrypting all with the new key.
Now, there is a problem in this approach as under :
I enter data as 'rakesh' (6 characters). When I decrypt it, it gives me the same string i.e. 'rakesh', but the length will be of 8 characters.( The decrypted string comes in the multiples of 8) .
When i try wo encrypt it with the new KEY, the encryption will happen for 8 characters and not for 6 ( which is the actual length of the string).
so, the strings will never match.
This thing is gonna happen everytime i change the KEY.
What I need is a way by which i can migrate directly from one KEY to other KEY without excryption / decryption.