One matter upon which I have been thinking recently is the matter of Authentication between Objects within Second Life.
For many systems it is necessary for them to be able to communicate with each other only if they share a common secret - a “password” is an example, and one used here. For instance, with a combat system, a cannonball should only be able to tell a ship that it has been struck and should take damage if it is part of the same “network”, or game (though clearly Piracy is Not A Game) as the ship itself.
In cases where all items are owned by the same person this is simple - one merely checks that the owner keys, which are I believe unforgeable, are the same, using some line such as if (llGetOwnerKey(id) != llGetOwner()) return; in one’s listen() event, when hearing a command. However, when objects may be owned by pretty much anyone, this will not work, and merely having the objects communicating on an unusual channel (-894029345, say) will not provide complete security, as listening devices exist which can scan for these things.
I was thinking of something a little more secure, yet remaining in-world and not requiring awkward and slow communication with, say, a server that keeps a record of permitted owners. To this end I created a small script this afternoon which demonstrates a challenge-response system between objects.
The basic functioning works thusly: each object holds a password, and when object A wishes to instruct object B to do something, B says “Hold on a second! I don’t know who you are. We must compare passwords. But clearly we cannot do so on an open channel - anyone might be listening. Here is a random integer for you as a challenge, to use as a salt in an MD5 function.”
A hears this integer and applies that salt to the password, then says the resulted salted password again. The important point about the function llMD5String and MD5 encryption in general is that, when a string is encrypted with a particular salt, there is no practical way to return to the original string given the result. So, even if someone is listening in and hears the salted password, it is of no use in determining the original password - but B can also salt the password with the same integer and compare the two to see if the original passwords were the same.
If B manages to do this it then says “right, you seem to know the password properly, I will allow you to instruct me” and, for the next minute, allows communications from that key to act on it. A then must repeat whatever command was issued.
The above may seem a little baffling if one has never heard of this sort of thing but I dare say examination of the script may make it clearer. Contrariwise, I confess that I really do not know an awful lot about this stuff compared to the experts and would welcome comments. I have posted the script on my Scripting Colloquium for simpler discussion, but here is as good a place as any too I suppose.
Whilst somewhat re-enabled in Aethernet terms, I am still unable to enter the Grid itself, and have been attempting to ameliorate the symptoms of my withdrawal with such things as the Scripting Section of the Official Forums.



Recent Comments