If you are using DropTools Community Edition, this article does not apply to you (as LiveCode Community Edition does not allow for securing stacks with a password). |
Securing Your DropTool
If you decide to create a DropTool, you may be concerned that you will not be able to secure your scripts, since LiveCode does not allow for substacks or objects to be copied from stacks that have been password protected.
The DropTools Palette has a clever feature that allows you to protect your stacks andHow Does It Work?
The DropTools Palette has a substack called "DTSecurity" that is itself password-protected. In that protected stack are handlers for encoding and decoding a string using a custom-built encryption method, as well as a handler for unlocking a stack, given an encrypted string as a parameter. (It also holds the main "installation" code of DropTools with the "cantAbort" property of the stack turned on, so no one can put a breakpoint in or attempt to command-period to break in and try to work with your unlocked stack.)
The stack that you want to protect needs to have a customAt the end of the drag-drop operation, the original DropTool stack is closed and purged from memory, so that the next time it is opened, the password is back in place and the stack remains secured.
What About Libraries?
Libraries are protected in a similar way; remember that a DropTool library is a substack of the DropTool stack. That substack, if password-protected, would need to have theHow Do I Set the uDTPassKey?
This is where the clever feature comes in: bundled with the DropTools Palette download is a DropTool stack file called "DropSecurity.livecode". Once you install it into the DropTools folder, it will show up in the DropTools Palette as a golden padlock:
And if you're concerned that the DropSecurity tool is unlocked, don't be - all it does is call on a handler in the already-protected "DTSecurity" substack of the DropTools stack to both encode the password and set the custom property of the target stack.
Important Note: Behaviors are NOT Protected
Since LiveCode only allows for the securing of stacks, if you have a behavior-based DropTool, the button that has your behavior code in itThe Bottom Line?
Your password protected stack will remain protected during the drag and drop process, and if you have password-protected libraries, they will remain secure as well.