Say, I have a function whose contents should be hidden. The general way to create such a function needs two steps:
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.)
asked 31 Mar '11, 07:10
A valid solution seems to be the following, even across different SA versions:
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.
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.
answered 01 Apr '11, 08:26