TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Grrr1337 on February 11, 2020, 05:27:34 AM

Title: Compiling to .vlx - protection principle for login
Post by: Grrr1337 on February 11, 2020, 05:27:34 AM
Hi guys,

VLIDE->File->Make Application->New Application Wizard..

What would be the default approach to protect multiple lisp files in order to have a global login check?
I mean every .lsp file could be wrapped individually like:

Code - Auto/Visual Lisp: [Select]
  1. (if (= (getvar 'loginname) "Thats_Me")
  2.   (progn
  3.     ; <all the bunch of .lsp code>
  4.   ); progn
  5. ); if

And then this bunch of .lsp-s can be complied into 1 .vlx

But to restructure my question - how would this (= (getvar 'loginname) "Thats_Me") can be applied only once to the whole .vlx application,
without having to include it manually in all the files...
Title: Re: Compiling to .vlx - protection principle for login
Post by: jtoverka on February 11, 2020, 07:10:35 AM
I wouldn't even use LISP to authenticate, it is easily hackable. Since I can redefine functions before loading your code. For example, someone can redefine getvar to do everything getvar does except for the loginname, they can just spoof the loginname and completely bypass that.

There is absolutely no security in LISP for this reason.
http://www.lee-mac.com/md5.html (http://www.lee-mac.com/md5.html)
You could use the MD5 cryptographic hash function, using a combination of loginname and machine product ID etc. but like the example above, it can be very easily bypassed.

However, for the average Joe, they probably wouldn't be smart enough to hack it.

As for your specific question, keep your original VLIDE project for development/debugging. Create a new project and a new file with all of your files in one file. Wrap it with that global login check. and compile.
Title: Re: Compiling to .vlx - protection principle for login
Post by: VovKa on February 11, 2020, 03:12:08 PM
can be applied only once to the whole .vlx application
create an additional .lsp file as simple as
Code: [Select]
(if (/= (getvar 'loginname) "Thats_Me")
  (exit)
)
add it to your application and move it to the top in your source files list
Title: Re: Compiling to .vlx - protection principle for login
Post by: Grrr1337 on February 12, 2020, 11:34:42 AM
can be applied only once to the whole .vlx application
create an additional .lsp file as simple as
Code: [Select]
(if (/= (getvar 'loginname) "Thats_Me")
  (exit)
)
add it to your application and move it to the top in your source files list

Thanks Vovka - now that file source list makes sense to me!  :-)