Improve company productivity with a Business Account.Sign Up

x
?
Solved

encrypt a shell script

Posted on 2000-08-09
10
Medium Priority
?
353 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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.

608 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