Author Topic: Compiling to .vlx - protection principle for login  (Read 174 times)

0 Members and 1 Guest are viewing this topic.

Grrr1337

  • Swamp Rat
  • Posts: 716
Compiling to .vlx - protection principle for login
« 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...
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)

jtoverka

  • Newt
  • Posts: 45
Re: Compiling to .vlx - protection principle for login
« Reply #1 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
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.

VovKa

  • Swamp Rat
  • Posts: 1186
  • Ukraine
Re: Compiling to .vlx - protection principle for login
« Reply #2 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

Grrr1337

  • Swamp Rat
  • Posts: 716
Re: Compiling to .vlx - protection principle for login
« Reply #3 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!  :-)
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)