Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

encrypt a shell script

Posted on 2000-08-09
10
Medium Priority
?
350 Views
Last Modified: 2013-12-06
Is there anyway of encrypting a shell script so that no one can look at it ?

whilst it can still run as usual ?

just curious cheers
0
Comment
Question by:Slightly_Imperfect
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 3855575
Well, there's no built in way on any Unix that I know to do that. But I can think of a couple of ways it could be done. One would be to have the encrypted script executed by a script or code wrapper that decrypts the script file and feeds it to a shell. The other would require writing a program that would replace the "#!/bin/sh" line in the script. That code would decript the contents of the script and feed the result to a shell.

The difficulty with all of these is that the decrypt key will have to come from somewhere and that a somepoint the plain text has to exist. A clever user could find the key or intercept the plain text to see what the script contents are.

Like most things in Unix there's probably another way to solve the problem. Why exactly would you want to have the contents of the script hidden?
0
 

Author Comment

by:Slightly_Imperfect
ID: 3856128
The reason we are after doing this is so the customer cannot get at our code !!!!  


i was thinking of uuencode or something similar !!!! then a c program just to go out and run the command so as nobody would see the code !!!


0
 

Expert Comment

by:mslightn
ID: 3857338
Does anyone know of a utility out there that might compile shell scripts?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Expert Comment

by:jlevie
ID: 3866597
Well if you really don't want a customer to get at the code then it needs to be a compiled program, not a script. As I mentioned, at some point in the scripts execution (assuming the use of a standard shell) the commands must exist as plain text. Even a moderately clever customer would be able to recover those commands pretty easily.

The only way that I can thing of other than compiled code to really hide what you are doing would be to use a modified shell that could read the encrypted script directly. In that case the crypto key could be hidden in the shell executable, so the script would be pretty secure.
0
 
LVL 85

Expert Comment

by:ozo
ID: 3866792
A compiled program can also be disassembled, If you really want to keep the code secure, you may want to use a protocol that only allows running the code, and not reading it.
0
 

Accepted Solution

by:
skakee earned 80 total points
ID: 3872137
If you are willing to shell out some dough ($899) you can buy "Shell-Lock" form Cactus International (www.cactus.com).  From their add in the back of a Sys Admin magazine: "SHELL-LOCK" is a shell script compiler which actually turns your shell script source file into a binary executable file.  As a result, you comiled source is safe from being modified or tampered with by your customer or comptitor."  SCO, AIX, Linux, Solaris, HP/UX are all suported.
0
 

Author Comment

by:Slightly_Imperfect
ID: 3874576
I have found a freeware shell script compiler called shc if anybody wants it

go to msn search and type shell script compiler !!!

you should have a page from someone called francisco rosales garcia

it is in gzip format !!! it works reaaly well !!!


cheers guys !!!
0
 

Expert Comment

by:mslightn
ID: 3875332
Does this compiler work for UNIX OS's, or just Winders.
0
 

Author Comment

by:Slightly_Imperfect
ID: 3875653
I have found a freeware shell script compiler called shc if anybody wants it

go to msn search and type shell script compiler !!!

you should have a page from someone called francisco rosales garcia

it is in gzip format !!! it works reaaly well !!!


cheers guys !!!
0
 

Author Comment

by:Slightly_Imperfect
ID: 3876641
It says it works on all unix backgrounds !! not to sure but it works on HP-UX.


0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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
Course of the Month10 days, 9 hours left to enroll

885 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