User:Clarknova Helvetic/Gen Chan

From Second Life Wiki
Jump to navigation Jump to search

This genChan() function returns a large negative number based on a key, a modifier, and a pin.

The number is within bounds for object-to-object chat channels, but out of range of the channel scanners currently on the market.

If the key, modifier and pin are the same, the channel will be uniform regardless of the script.

This isn't randomness, and it's not encryption, but it's simple and quick, and good enough to make reverse engineering of the system communications in real time super duper impractical.

<lsl>integer secret_channel;

// Where k is the owner's key, mod is either 2 or 3, and pin is a number between 1 & 500,000

integer genChannel(key k , integer mod, integer pin) {

   float a = (float)("0x"+llGetSubString( (string)k, mod,-1));       
   integer b =  llRound( llFabs(a) - a*2 + pin );          
   return b;

} </lsl>


You can define the channel in state_entry() thus:

<lsl>secret_channel = genChan(llGetOwner() , 2 , 12345); </lsl>

As long as the pin is secret your cooms will be too.