The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
executing an encrypted script ajnabi Shell Programming and Scripting 2 08-08-2006 10:35 AM
netrc file encrypted password ggowrish UNIX for Advanced & Expert Users 2 06-17-2004 06:15 AM
encrypted files w33man UNIX for Dummies Questions & Answers 3 03-02-2004 12:06 PM
How to decrypt a file which is encrypted in UNIX, In Windows NT gorantla Shell Programming and Scripting 3 01-29-2002 02:19 PM
How to decrypt a file encrypted with vi? Gerry UNIX for Dummies Questions & Answers 1 04-22-2001 03:44 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-14-2009
nsharath's Avatar
nsharath nsharath is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 79
Smile how to run an ENCRYPTED file?

Hello sir,
we are able to do :
Quote:
[...]# ls
list of all files in the current directory
But when I goto /bin or /usr/bin to see the code of "ls". I found it to be encrypted. So can u please tell me how to encrypt a code in such a way that the user can run it but cannot see the source code.

example:
if I have a shell script named "sample.sh" as :
Quote:
echo "hello how are you"
What is the command to encrypt it so that I can still execute it using 'bash' but cannot see the source code.
I tried using 'gpg' but it didnt work.Can u please tell me how
  #2 (permalink)  
Old 03-14-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,937
First off, 'ls' is not an "encrypted script", it's not a script at all -- it's programmed in C, which becomes machine language, which you potentially could understand if you were very determined. It's not encrypted, just obscure.

Second, 'chmod -r' will prevent the user from reading a file. Much better security than trying to obfuscate it, since that's all it would amount to -- after all, a file the user really can't decrypt is a file the machine really can't decrypt. But for the halibut, here's how I once embedded encryption in scripts. Without the password, they can't examine the source code or run it.

Last edited by Corona688; 03-14-2009 at 01:14 PM..
  #3 (permalink)  
Old 03-15-2009
nsharath's Avatar
nsharath nsharath is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 79
Smile one more DOUBT

hello sir.
I did use the link u gave me.
there also we are still able to see the source code.
I want to know how to obfuscate a code so that the user can use it but cannot see the logic that I used....it must come in all "#&*!" symbols like the code that comes when we open "ls" from /bin or /usr/bin

I cant use "chmod -r" as the user can be root.He would change the permission and see the code.I dont want the root also to see that code.
How can I achieve it sir ?
  #4 (permalink)  
Old 03-15-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,937
Like I said, a file the user really can't decrypt is a file the machine really can't decrypt. To get something even root can't decrypt you'll need something out of root's hands, like the kernel or a hardware cryptoprocessor, to do the dirty work. Sadly this goes beyond my knowledge, but the TPM's in modern computers might be related to this.
  #5 (permalink)  
Old 03-15-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,937
Quote:
Originally Posted by nsharath View Post
I want to know how to obfuscate a code so that the user can use it but cannot see the logic that I used....it must come in all "#&*!" symbols like the code that comes when we open "ls" from /bin or /usr/bin
Well, you could write something in C instead of shell. But that's not encrypted, just obfuscated, a determined user could still piece things together. And a system tracing program would be able to tell what system calls it made no matter what language it was written in.
  #6 (permalink)  
Old 03-16-2009
robsonde robsonde is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 162
why do you care if the root user can see your script??

I feel you have a bigger security problem if you NEED to hide script from the root user.

Last edited by robsonde; 03-16-2009 at 07:15 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0