PDA

View Full Version : Run Encrypted External Lua file


goukilord10
01-24-2008, 09:30 AM
the ability to run an encrypted external lua file
considering AMS can already encrypt and decrypt this shoul not be a big of a problem.

RizlaUK
01-25-2008, 05:53 AM
AMS already can run encrypted scripts (with a little imagination)

first you need to encrypt your scripts, then use the below code to run them

in page onshow you set each script to a object like this:
strFile = TextFile.ReadToString("C:\\MyFile.txt");
strText = Crypto.BlowfishDecryptString(strFile, "testpass");
Page.SetObjectScript("Button1", "On Click", strText);

only draw back is this will only work for page objects

goukilord10
01-26-2008, 05:17 PM
only draw back is this will only work for page objects
yes true

We really need more security for scripts because its too weak now.

RizlaUK
01-26-2008, 05:42 PM
Yeah, it would be nice to have

either
Application.RunEncryptedScriptFile (string Filename, string Password)
or
Application.RunScriptFromMemory(var strDrycryptedScript)

you can decrypt a script to temp folder run it and delete it straight away, but with something like the above would be a better option

Darryl
01-30-2008, 08:32 AM
Thanks for the suggestion. I've submitted it for consideration.

REF: 17185

Desolator
01-30-2008, 03:56 PM
I prefer to compile the file to bytecode using luac and loading it. Just keep a copy of it in plain code because if you lose it there's no easy way to get the script back from bytecode.

RizlaUK
02-02-2008, 01:29 PM
if you lose it there's no easy way to get the script back from bytecode.

Wrong, lua bytecode is not 100% secure, with certain tools you can easily decompile a bytecode file