Jump to content

protect/unprotect for autocad lisp


ewan_m

Recommended Posts

Posted

Hi Everyone,

 

I'm trying to find a way of compiling my lisp routines but keeping the .lsp so my menus and dos batches don't notice the difference when I distribute them to other users. I've been told that "protect.exe" and "unprotect.exe" exist to give a minimal level of security but it might be enough to discourage complete theft.

 

Does anyone know where I can get both these files and / or a better alternative with the same or better result?

 

Cheers,

 

Ewan

Posted

There are many ways to do this.

 

The method I use, is to create a project within the VLIDE, and compile it into FAS. This provides a single file which my team loads with a conditional load statement in ACADDOC.lsp, and I still have all of my source code for code maintenance.

 

This provides an adequate level of security to my source code. But this alone does not prevent anyone from using my production tools. For example: someone could simply drag the FAS into their AutoCAD session, and have access to all of my production tools.

 

For this task, I also use a simple defun which checks for authorized users, and if not 'authorized'... my code re-defines each production tool with an error message which includes my internal contact information. Others have instead added a simple expiration check, so that the code is only valid for one year, etc.

 

User authorization is completely optional, and at the developer's discretion.

 

Hope this helps!

Posted

I wrote elsewhere like renderman that we used to add the serial numbers to our lisp code and then use protect (PS do you want a copy of "unprotect" its not real good protection) any way there is a simple way to add the serial checking to your code using the operating system you can write a batch file (txt file) that copies the serial code to every lisp file you have then protects it.

 

Batch file

copy serial.lsp+mylisp1.lsp mylisp1protect.lsp

Protect mylisp1protect.lsp f:\lisp\mylisp1.lsp

 

keep repeating for all lisps

 

The serial lsp could just look for a file somewhere say if you work on a network like Companyname. It a nucianse if someone borrows the code so they know they have done the wrong thing when they read a message then lisp exit's (exit)

 

found a copy

(setq run (getvar "_pkser"))
(if (or (= run "123-22341988")(= run "123-123560429"))
(princ "\nSecurity check passed")
(progn
(princ "\nYou have tried to run my software on a non authorised machine")
(princ "\nPlease contact me on 123 4560789")
(/e)
)
)

 

It does work had some one ring up once who was trying to install on a friends machine.

 

Word of warning though if you lock the code it must still work after your gone or get new pc's etc

  • Like 1
Posted

That's a very interesting thread, But unfortunetly I did not get the way of adding codes to a routine to secure and protect a production.

 

Or is it just to add the above codes to a routine with consideration to the version serial number that would be supported by

the (getvar "_pkser") and have to change the equal to run according to our version serial number ?

 

Thanks

Posted (edited)

As a commercial product you want to stop people just giving it to their mates, what we were doing was embedding at the start of every lisp routine a check to see if it was a valid serial number for that client. new client meant change the serial number in one lisp only ! Run the batch file and that client had a unique set of lisps that would only work with his individual autocad.

 

We had around 100 lisp's so changing one only makes sense.

 

Rather than check the serial number you could open a file and read a code word out of it just don't tell everyone where it is. Or just check it just exists, Autocad uses a .lic file for network versions, no lic no go, you can bury a registry entry if you want.

 

Protecting the file just means that if someone opens the file they just can not read the code and 99% will go away.

Edited by BIGAL
  • 13 years later...
Posted

Create your own encrypt and decrypt functions first.

 

Encrypt function moves forward any normal character by your passcode value.

To encrypt a text string, take each character, find its ASCII value, add passcode value and convert a new character. Recycle ASCII value to first character if it is beyond character code list.

 

Decrypt function moves backward the encrypted character by your same passcode value.

To decrypt a text string, take each character, find its ASCII value, deduct passcode value and convert a new character. Recycle ASCII value to first character if it is beyond character code list.

 

Passcode value may be a constant, expiry date or a value stored in a file or in registry.

 

Encryption routine:

Read pass code and calculate its translation value.

Read Normal Text string

Encrypt the text with the passcode value.

Store in a file and in a registry key

 

Decryption routine:

Read pass code and calculate its translation value.

Read the encrypted text string

Decrypt the text with the passcode value.

 

 

 

 

Posted

As I have posted before there are multiple ways to check is end user valid say using a Fas or VLX file.

 

Like post above Look for a key

Hard disk ID

User ID

Network card ID

Ping a remote server

Cad serial number

I am sure there are more.

 

 

  • 1 year later...
Posted (edited)

create a fas file without vlide

(vlisp-compile 'st "C:/your-folder/yourfile.lsp")

Edited by Ger Aven
Posted

Pretty sure you must load Vlide for your code to work, just one of those buggy things.

 

(if (null vlisp-compile) (c:vlide T)) 

 

You can use lisp to compile multiple files in one go using method above.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...