Solved

Encrypting a Unix Shell script (so that source code is not visible : intellectual property protection)

Posted on 2009-07-15
4
598 Views
Last Modified: 2013-12-26

Is there a way to encrypt the source codes of a Shell script that we've written and
yet still allow this "encrypted" to be able run?

I recall ever downloading some  .sh  file from Sun MIcrosystems and when you run
the .sh file, it generates out several file (and this .sh file contains non-readable
characters) .  The file I downloaded from Sun looks like :
--------------begin--------------
$cp$!#%#$@%!$#@%$^%^
.......
--------------end----------------
0
Comment
Question by:sunhux
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 300 total points
ID: 24861594
you can use shc to encrypt the shell script. download and compile it first:

http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.6.tgz
0
 
LVL 5

Assisted Solution

by:dcesari
dcesari earned 90 total points
ID: 24868264
Don't know much about encrypting shell scripts, but maybe what you are talking about from Sun's site is not an encrypted shell but rather a so-called shell-archive, i.e. a package of files (possibly binary), like a tar archive, embedded into a shell script in such a way that if you run the shell script it will extract the files to the filesystems; it can be created on Linux with the shar command.
0
 

Author Comment

by:sunhux
ID: 24885281
Thanks dcesari/Omar.

Hi Omar,

Can this encrypted shell script be run at Unix command prompt just like
running a normal Shell script  (certainly I can't do "sh -v script" or
"ksh -v script"  as the codes are no longer readable)
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 300 total points
ID: 24887162
yes
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question