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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to encrypt and decrypt a file laknar Shell Programming and Scripting 2 12-11-2007 08:18 AM
AWK script: decrypt text uses frequency analysis SerJel Shell Programming and Scripting 4 11-27-2007 03:16 AM
Decrypt Des file - then encrypt frustrated1 SUN Solaris 0 09-07-2006 05:38 PM
encrypt and decrypt password sanwish Shell Programming and Scripting 2 07-14-2006 01:59 PM
Encrypt & Decrypt a String aldowsary Shell Programming and Scripting 6 05-15-2005 06:32 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-11-2007
shary shary is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 61
Encrypt and Decrypt script

Dear Experts,

I am using one script name :volume.sh and its written in bash shell script.
I just want to encrypt the script so that any one else cannot see it.
please tell me the commands how to encrypt the script as well as to decrypt it.

Regards,
SHARY
  #2 (permalink)  
Old 12-11-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Are other people supposed to be able to run it while it's encrypted, if so how is the interpretor going to understand the file?
  #3 (permalink)  
Old 12-11-2007
shary shary is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 61
Yes i want that the other people can also run the encrypted script .
But i dont want to show them the code is there is any way out.
  #4 (permalink)  
Old 12-11-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Out of interest, why?

Is this security through obscurity?

If the interpretor can decode the script to run it, why can't a person?

Start the file as follows

Code:
#!/bin/sh
cat >/dev/null <<EOF
.....
tons of rubbish
....
EOF
then follow that with the working parts all on a single line using the ";" separator.
  #5 (permalink)  
Old 12-11-2007
shary shary is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 61
Dear Sir ,

I am totally lost what you have mentioned . I mean i didnt understand the technique to encryt and to run the shell script.

Regards,
SHARY
  #6 (permalink)  
Old 12-11-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
An obscure script....

Code:
#!/bin/sh
cat >/dev/null <<EOF
ssdf
sdf
sdfhgfgjhghk
ghjgfjgfjgh
jhkjh
k
jhk
jhlkjhljklkj
jghjghghj
jh
kljh
kljh
ljk
l
kjlkjljkkj

jk
l
kj
lkj
ljklkjlkjljkl
kjl
jk
l
kj
l
jk
l

jk
lkjljk
l
kjhjkljhklhfjkhfkjhkjhkjhkjh
EOF
first() { echo $1 }; second() { echo $2 }; third() { echo $3 }; ps -ef -o "pid etime comm" | while read PID ETIME COMM; do case "$ETIME" in; *:* ) DAYS=0; HOURS=0; MINUTES=0; SECONDS=0; case "$ETIME" in; *-* ) X=`echo $ETIME | sed y/-/\ /`; DAYS=`first $X`; ETIME=`second $X`; ;; * ) ;; esac; X=`echo $ETIME | sed y/:/\ /`; case "$ETIME" in; *:*:* ) HOURS=`first $X`; MINUTES=`second $X`; SECONDS=`third $X`; ;; *:* ) MINUTES=`first $X`; SECONDS=`second $X` ;; *) ;; esac; HOURS=`echo $HOURS + \( $DAYS \* 24 \) | bc`; MINUTES=`echo $MINUTES + \( 60 \* $HOURS \) | bc`; SECONDS=`echo $SECONDS + \( 60 \* $MINUTES \) | bc`; if test "$SECONDS" -gt "3600"; then echo $PID $COMM; fi ;; * ) ;;esac;done
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 08:45 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