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 Volker Barth |
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. answered 31 Mar '11, 07:24 Volker Barth Just a remark: The hidden definition does also contain information about the function's parameters and return type. This is still available in system table sysprocparm - for obvious reasons: Otherwise, the function would not be usable anymore IMHO...
(31 Mar '11, 07:32)
Volker Barth
To the iAnywhere experts: Is my assumption that this approach will work over different versions (at least v8 - v12) correct?
(01 Apr '11, 03:33)
Volker Barth
|
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 answered 01 Apr '11, 08:26 Breck Carter 1
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.
(01 Apr '11, 08:37)
Volker Barth
Replies hidden
Oh well, I'm too good at obfuscating, should have written "encrypted" instead of "enctrypted". One of my key problems:)
(01 Apr '11, 08:46)
Volker Barth
|