user3835935
user3835935

Reputation: 67

Compile tcl file in linux

I wrote script in tcl and want to protect it. Is there any way to compile the script so no one could see the code inside?

What is the conventional way to protect tcl script?

Upvotes: 0

Views: 922

Answers (2)

Donal Fellows
Donal Fellows

Reputation: 137607

There's a few ways, depending on the level of sophistication of protection you want:

  1. Against the least sophisticated users, just changing the extensions on the filenames may be enough (e.g., foobar.tcl to foobar.private).
  2. You can wrap the files up inside an archive of some sort (e.g., a starkit, or a ZIP archive which is natively supported in Tcl 8.7); the archive might be combinable with a suitable runtime to make a single-file executable.
  3. You can use the Tcl Dev Kit's “compiler” (Tcler's wiki page has many links) to create an obfuscated bytecode file. This requires a small extension to load, but the obfuscation is enough to defeat all but the most sophisticated of attackers. This can be mixed with the previous two techniques.
  4. The ultimate in protecting a file is to use a full compiler like tclquadcode (experimental, but might do good things for you). The output of such programs is exceptionally hard to reverse engineer; it looks like machine code from another planet!
  5. If even that's not enough, you have to go down the route of running the code as a web service and only allowing users to use it remotely; stealing code is (theoretically) impossible in that scenario, or at least (practically) incredibly difficult. This is a very large topic of its own.

Upvotes: 1

Pradeep Mahato
Pradeep Mahato

Reputation: 51

You need to obfuscate your TCL file. Check this.

Upvotes: -1

Related Questions