Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-07-15
4
Medium Priority
?
605 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 1200 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 360 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 1200 total points
ID: 24887162
yes
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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 …
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

715 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