phoboslab/Ejecta — pull request #242 by finscn (2013-10-09 13:52:43+00:00)
Title: add JS File Encryption(Encode) Tool

This tool use for protect your js file in Ejecta-Project

Theory:
* Use this tool encrypt the js file with a key.
* The encrypted file has a special header.
* When Ejecta loads js-file and finds the code has the special header, Ejecta decode the code.
* Do other things as same as before.

My english is very poor , so if there are some wrong words please tell me and I am so sorry for that.

README
====================

JS File Encryption(Encode) Tool.

-------------------
Command-line
-------------------

$ node encode-script.js secret-key input-file output-file

Info:
secret-key : Any string without Breakline. It's a key used for encryption.
input-file : the original js file that waiting for encrypting.
output-file : the new encrypted file's name. It will overwrite the file with the same name.

-------------------
Example
-------------------

Run the command in terminal:

$ node encode-script.js DoNotGuessTheKey game-original.js ../App/game.js

Then in Ejecta :

ejecta.include("my-game.js");

Yes, there is no different from before.

-------------------
NOTE
-------------------

This tool will CHANGE the "EJJavaScriptView.h" file.
Because the secret-key must be written into the "EJJavaScriptView.h" for security.