The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 11-17-2008
dave123 dave123 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 46
Okay i found one way with rot13
Say your script is called "script.sh". You can "encrypt" it with:

Quote:
shell$ cat script.sh | tr 'a-zA-Z' 'n-za-mN-ZA-M' >skrypt.sh
Then put this code at the very start of the encrypted script "skrypt.sh":
Quote:
#!/bin/sh
FIFO=/tmp/__skrypt_$(date +%F)_$$
mkfifo $FIFO
sh $FIFO &
tr 'a-zA-Z' 'n-za-mN-ZA-M' >$FIFO <<EOF_EOF
...and put these lines at the very end of the "encrypted" script:
Quote:
EOF_EOF
rm $FIFO >/dev/null 2>/dev/null
This isnt the safest but will deter most, plus you can make it stronger by double encrypting etc...

I am trying to work out another way with md5 which would be better i think!