?
Solved

complie/hide  csh script

Posted on 2001-07-26
3
Medium Priority
?
264 Views
Last Modified: 2013-12-27

I have a csh script that I do not want users to view/read permission on it. Is there any way I can make a binnary  a binary file of it or encrypt/black-box like it..

0
Comment
Question by:raza
[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
3 Comments
 
LVL 5

Expert Comment

by:paulqna
ID: 6326068
Of course chmod 700 gives only the owner and root permission to read/write/execute the file, but if this is not what you're looking for you can encrypt the file using the crypt command or install pgp.

http://pgpdist.mit.edu/distserver/PGPcertsrv_2.5.8_Sol_FW.tar.gz
0
 
LVL 14

Accepted Solution

by:
chris_calabrese earned 100 total points
ID: 6326926
I'm guessing you've embedded passwords in your script or some such.

Instead try putting the passwords in a data file and making the script setgid to a group that is used for nothing but controling access to that file.

The ony way to make a CSH script itself non-readible is if you do something similar with a suid/sgid wrapper that executes the actual CSH script, so it's no easier.

As for compiling the script, I'm not aware of any CSH compilers.

I have seen some SH and KSH compilers, and there's a feature in KSH for dumping/restoring the parse tree, which gives similar effect.  But nothing for CSH.

But meanwhile, this doesn't really help anyway since the determined attacker would just get a dis-assembler and de-compiler and figure out what's going on anyway.  And if you only want that level of protection, you can obscure the sensitive data within your existing CSH script.  Something like like store it XOR'd and then XOR it back to the original right before using it.  This won't stop someone from analyzing the code and figuring out what's going on, but at least the strings won't directly appear in the script.
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6579036
Umm, I hate to sound ungrateful, but why did you give this answer a 'C' grade?  It's extremely complete and well thought out.  The fact that it doesn't solve your (narrowly defined) problem indicates that your problem may be insolveable.  Don't feel too bad, though, the record companies are still learning this lesson about bits being inherently copyable too.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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