Solved

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

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.
Suggested Courses

630 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