To run a stack delivered from a server is easy in LiveCode - run this in the Message Box:
Code: Select all
go url "http://fourthworld.net/revnet/devolution/4W_gzipper.livecode"
Any help would be appreciated. Thanks
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
go url "http://fourthworld.net/revnet/devolution/4W_gzipper.livecode"
I had a lot of problems using the above method in Android (for "start using" the stack at least ...) - it may well be that it doesn't work there as described. So I dl' the stack to specialfolderpath("cache") that is semi-persistent, and use it from there.newpie wrote:To run a stack delivered from a server is easy in LiveCode - run this in the Message Box:[...] is there a way to encrypt it in .livecode state?Code: Select all
go url "http://fourthworld.net/revnet/devolution/4W_gzipper.livecode"
Code: Select all
on mouseUp
get encStrg(URL "binfile:C:/Users/myName/Desktop/TestStack.rev")
put it into URL "binfile:C:/Users/myName/Desktop/cryptStack.rev"
end mouseUp
Code: Select all
on mouseUp
get decStrg(URL "binfile:C:/Users/myName/Desktop/cryptStack.rev")
put it into URL "binfile:C:/Users/myName/Desktop/plainStack.rev"
end mouseUp
Code: Select all
function encStrg Strg -- Encrypt the data
put char -1 of the millisecs into MyChar
set the randomSeed to MyChar & MyChar & MyChar
put random(900000000) + 99999999 into MySalt
delete char 1 of MySalt
put "My long, complicated & elaborate PassWord v1b22!" into myP -- ###
encrypt Strg using "aes-256-cbc" with password myP and salt MySalt
get B2H(it)
return it
end encStrg
function decStrg Strg -- Decrypt the data
put "My long, complicated & elaborate PassWord v1b22!" into myP -- ###
put H2B(Strg) into MyVar
put char 9 of MyVar +1 into MyPass
decrypt MyVar using "aes-256-cbc" with password myP
return it
end decStrg -- OK
function B2H pString -- from libHash-Hmac V 2.3, http://marksmith.on-rev.com/revstuff/
repeat for each byte c in pString
get bytetonum(c)
put baseconvert(it,10,16) into tTemp
if it < 16 then put "0" before tTemp
put tTemp after tHex
end repeat
return tolower(tHex)
end B2H
function H2B pString -- from libHash-Hmac V 2.3, http://marksmith.on-rev.com/revstuff/
repeat with n = 1 to length(pString) - 1 step 2
put numtobyte(baseconvert(byte n to n + 1 of pString, 16, 10)) after tBin
end repeat
return tBin
end H2B
... if you have full control on your server or are very lucky. There's no sufficient information, too much outdated/ missing links, and obviously nearly nobody is using it. On the typical "rented webspace with PHP & MySQL" (that I have to work with) I tried ad nauseam, with no success at all.ghettocottage wrote:You can use Livecode server as an intermediary between your app and your database.
Code: Select all
libURLDownloadToFile "http://server.org/cryptStack.runrev",specialfolderpath("cache") & "/cryptStack.runrev","downloadComplete"
Code: Select all
on mouseUp
set the defaultfolder to specialfolderpath("cache")
get decStrg(URL "binfile:cryptStack.runrev")
put it into URL "binfile:plainstack.runrev"
end mouseUp
Code: Select all
on mouseUp
set the defaultfolder to specialfolderpath("cache")
go url "binfile:plainstack.runrev"
end mouseUp
This will not work. The Standalone is your runtime app - it contains the LC code needed to run your stack. You may hide it, but you cannot close it.newpie wrote:c. the startup app closes itself
Sure it can be copied, modified, whatever. And if you have a backup program, shadow copy, "file history" running it will be copied sooner or later, anyways. Even in .\temp.newpie wrote:So my question is the livecode stack vulnerable to be taken out of cache while it is in a decrypted state (plainstack.runrev)?
Code: Select all
global gTheGlobal
On PreopenStack --on the exchange stack script
if gTheGlobal then
set the passkey of me to ThePassword
else
quit
end if
end PreopenStack
Code: Select all
set the passKey of this stack to "1234"
--do your stuff
set the password of this stack to "1234"
save this stack