on 2011 Mar 31 8:10 AM
Say, I have a function whose contents should be hidden. The general way to create such a function needs two steps:
:::SQL
create function myFunction() returns varchar(255)
begin
return 'SomethingNearlySecret';
end;
alter function myFunction
set hidden;
After the second step, the function's original definition is obfuscated and cannot be queried from the system tables.
However, the current transaction log contains both statements and therefore still has the definition available. The same would be available when the statements will be distributed by SQL Remote's passthrough mode, and the remote would run in verbose mode.
Is there a way to create a hidden function (or procedure, trigger or view) in one step, not leaving the original definition in the log file?
(Note: I'm aware that this is just obfuscation and not strong encryption.)
A valid solution seems to be the following, even across different SA versions:
The reload.sql file will contain a create function statement with the undocumented CREATE ... HIDDEN syntax, something like
create function myOwner.myFunction hidden '(()(()**...$';
This particular statement can be run against the original database and will create the hidden definition without leaving the original statement in the log.
This seems to work with ASA 8.0.3 and SA 12.0.1 though I'm not sure whether the hidden definition is truly version-independent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another workaround (or enhancement, depending on your point of view) might be to store the critical core text of the procedure in a LONG VARCHAR column in a CREATE TABLE ... ENCRYPTED, and run it with EXECUTE IMMEDIATE.
Kludgy yes, but encryption beats obfuscation.
Breck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you suggest to store in a table/column with DBA-only access? Otherwise, the table encryption wouldn't protect against querying that table, only against database file inspection.
And in case the column contents itself should be enctrypted, then the according encryption key must be stored anywhere else, lifting the encryption/obfuscation discussion to the next level:)
Besides that, an interesting suggestion, for sure.
I think we can all decipher your meaning.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.