Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Obfuscating strings in lsl

Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-05-2007 11:50
Another random small piece of a larger puzzle. In Javascript, and HTML, you can use things like "&212;" instead of a character. I've been toying with the idea of creating some sort of an encoding function, that could encode a given string on my end, then I could insert the encoded data, and then use a function in the script to decode the encoded data.

I wonder though, is there a better way? right now I'm thinking about passing a list of numbers to the decoder... to oversimplify it.. "4,1,4" would return the string "dad". But I find myself wondering if there's a way to encode strings into keys or something.. and then decode those keys to get that string back out (unmolested).

is this possible?
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
02-05-2007 12:39
Maybe see if llEscapeURL and llUnescapeURL do what you want?
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-05-2007 12:50
From: Winter Ventura
Another random small piece of a larger puzzle. In Javascript, and HTML, you can use things like "&212;" instead of a character. I've been toying with the idea of creating some sort of an encoding function, that could encode a given string on my end, then I could insert the encoded data, and then use a function in the script to decode the encoded data.

I wonder though, is there a better way? right now I'm thinking about passing a list of numbers to the decoder... to oversimplify it.. "4,1,4" would return the string "dad". But I find myself wondering if there's a way to encode strings into keys or something.. and then decode those keys to get that string back out (unmolested).

is this possible?


have you tried using llMD5String? This is s standard LSL Function for encrypting strings.
Someone has posted RSA level encryption to the library and recently we talked about implementing TEA (Tiny Encryption Algorythm) but although I threw together the routines I've not tested them.
Something Something
Something Estates
Join date: 26 Sep 2006
Posts: 121
02-05-2007 13:10
Maybe you want llStringtoBase64 and llBase64toString ?

http://rpgstats.com/wiki/index.php?title=Base64
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-05-2007 13:21
Edit:
I don't need anything fancy, or $DIETY forbid, laggy.. looks like the base64 system will be better for my needs, as I want to DECODE the encoded information "on the fly".. rather than encode.

Thanks for pointing me to that part of the wiki. I couldn't find it!
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-05-2007 13:55
err, why not jsut make your script unreadable by making it no mod ?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-05-2007 14:13
I'll explain it to you in world.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura