Encrypting strings in PPL.

What if you want to protect a file from sneaky eyes? The best solution is to encrypt the file using a very strong password that only you know about. PPL comes with a nice function called Encrypt() that can do this for you very easily.

s$ = "HELLO WORLD!";
Encrypt(s$, -1, "MYKEY", True);
ShowMessage(s$);
Encrypt(s$, -1, "MYKEY", False);
ShowMessage(s$);

In the following example we encrypt the string “HELLO WORLD!” using an encryption algorythm that uses the key “MYKEY” to encode the result string. The last parameter of the Encryt() function specify if we are encrypting or decrypting the string, true means encryt and false means decrypt. It is always a good idea idea never to leave a key as a regular string in your code even though the .ppc file that PPL generates is encrypted and compressed, it can be easier for a hacker to decode. Try to build your key string using code with mathematical code if possible.