Solved

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

Posted on 2009-07-15
4
602 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

728 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