Solved

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

Posted on 2009-07-15
4
596 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now