AIML: Securing Your Code

AIML is an amazingly flexible language and to make it so universal, AIML files are plain text. This is great for the usability and readability of the files in different applications but can raise issues about people stealing your code and claiming it’s theirs. In this blog post, I’ll explain some simple tricks I use to ensure that I can prove that I’ve written the AIML if my files were to fall into the wrong hands.

I’ll explain them in order from least secure to most secure.

Why would this happen?

The safest way to use and secure your AIML is by uploading them to our servers at Pandorabots. However, if you decide to host them locally or make a copy of them, it’s wise to take precautions just in case.

Let’s imagine you uploaded your AIML files to a file sharing service to make them available to others, someone could copy them and pretend they were their own work. Copied your AIML set to a DVD or USB drive? Left it on the train? Oops! Let’s hope nobody grabs your files. Computer infected with a virus/malware? While these events and the chances of anyone stealing your work are minimal, I find it reassuring to know that I’ve protected them.

Include the author name in the heading

The simplest way of demonstrating ownership is to add a comment field with your name. This is probably the least secure way, as it is easy to edit or remove this line but it may make a potential thief think twice if they believe the code is already available on the internet and people already know who the author is.

Write your name in a category

Adding categories similar to the above at random points in your files means that the thief has to remove them manually and will hopefully miss one. For extra security, make similar categories at different places in your file and duplicate this over your entire AIML set.

Hide your name in categories

A cunning thief may just do a global search/replace for your name. Make his life harder by adding a few extra characters into your name. It’s unlikely the thief is called SaTEVExWORSWIbCK. For extra security, make the random characters different in each category you use.

Disguise the categories

A thief may be put off from changing anything he believes is part of the bot’s core code and could potentially stop the bot from working. Categories with patterns like KERNEL CORE or INITIALISE BOT may make them think twice about amending them, especially if the template isn’t immediately obvious that it contains your name.

In the above category, I spell my name backwards in the template. You can also use the extra characters trick to make it even less obvious. In the category below, my name is written in reverse in the middle of the template.

Remember that these categories are in the middle of possibly thousands of others and so a thief will either not look for them or quickly glance over them.

Hidden in plain sight

Rather than using obscure pattern names or templates, I’ve found the most secure way is to use categories like above. Placing these innocent looking categories in your code won’t trigger a thief’s suspicion, especially if they are hidden in different parts of your AIML set, which could potentially contain thousands of categories.

How do these categories prove I wrote them? Take a look at the initial letters of each word in the template to see WoRswIck and Steve wrote me ;) It’s a good challenge creating these and if you add lots of them to your AIML set, no thief will examine each category to spot them all.

Hidden in plain sight and disguised

Here’s a challenge: Where is my proof of ownership in the above categories? (answers at the end of the blog)

Remember a potential thief is unlikely to examine each of your categories looking for things like this and if you use several similar ones dotted around your files, it’s highly unlikely a thief will catch all of them.

While these methods are not infallible, they will at least give you some proof of ownership unless of course the thief has the same name as yourself! However, the chances of that and also you knowing what categories trigger the responses are slim.

IMPORTANT!!!

Hiding lots of these categories in your AIML set is a simple and effective way of proving your ownership. I have around 50–60 of these things dotted around Mitsuku’s 350,000+ categories and if there was ever a legal challenge to any of them, I could say to a lawyer, check out the category called “GOLD RUSH MINERS” (or whatever) to show that it’s highly unlikely the thief would have included my name hidden there and even more unlikely that I would somehow magically know this.

If the thief had spotted this category and removed or amended it, I could use one of the other 59 categories in the set. It’s doubtful that even the most dedicated thief would have checked 350K+ categories.

BUT (and it’s a big but!)

Hiding categories like these in your files are a great way to fool a thief but as they are so well hidden, they are also hidden from you! If you forget what they are, there’s little or no chance that you will be able to find them and they will just be dead, useless code.

IT’S VITALLY IMPORTANT THAT YOU CREATE A LIST OF THESE CATEGORIES IN A SECURE FILE JUST IN CASE YOU EVER NEED THEM!!!!

Excuse the capitals and exclamation marks but it really is that important. I would have underlined it and made it red if I could!

You may think you will remember the categories you created to prove ownership but I can assure you that after a few months (or even years in my case) you will have forgotten what you wrote and if the day ever comes when you need to demonstrate that the files are yours, you won’t be able to.

While these methods probably don’t have a great deal of legal standing, as I’m sure a clever lawyer can find a way around them, they will at least offer you some protection of your hard work.

Answers
Random Female Names — Take the initial letters of each name on lines 2,3 and 4 of the template. Spell them backwards to get steve wrote me
Moon Eclipse — Take the initial letters of each word, spell them backwards to get steve made me
These are just examples. For your own categories, you should include your full name.

To bring the best bots to your business, check out www.pandorabots.com or contact us at info@pandorabots.com for more details.