[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Protect LISP code
Tip# 3490 By Leonid Nemirovsky On 10-Sep-2010
Rated By 1 users Downloaded : 1596
Categories : Programming Examples, LISP Code Modules
Software type : AutoCAD 2011
Rename File To : protect_example.lsp
This method for protecting LISP code consists of three functions separate from the main program.

Frequent tipster Leonid Nemirovsky shares his method for protecting LISP code. It consists of three functions separate from the main program. The first function is a counter that keeps track of how many times the program has been run, and the second provides a "key" that allows the function to run regardless of the count. The third is a wrapper function that checks the counter and/or the presence of a key, and either allows the program to run or prevents it from running.

In this particular version the counter is local to the drawing, but it could be altered to store the counter in a file or the registry. It also requires that you compile your code so that the security method is not exposed. You can compile LISP code to an FAS or VLX file using functions built into the VLISP editor; there are also third-party compilers available. Although nothing is perfectly secure, this method should work just fine in many situations. Thanks for sharing, Leonid.


Average Rating:

User comments
Comment by Peterson,Pete
Posted on 2010-09-29 10:38:02
Impressive. . I'm still using AutoLISP and R14. Ya. Right. R14. It does what I need. Loads instantly and doesn't call home - ever. . . I've never compiled. Would one of the 3rd pary compilers accomplish the same protection for AutoLISP?