encrypted files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers encrypted files
# 1  
Old 03-02-2004
encrypted files

Hi lads me again

trying to get a wee bit fancy with my scripting

anyway it dosn't seem to want to run (strange as it may seem)

I encrypted a file renamed it and wrote another file that unencrypts it
(it contains passwords) (and b4 anyone says I am doing this for my own reasons)

In a case statement I call the file but when I run the case choice, it justs echos the contents of the file to the screen


Any Ideas (All ideas considered)

Cheers the w33man
# 2  
Old 03-02-2004
If I understand... Instead of just this:
unencrypt somefile
do this:
unencrypt somefile | ksh

That way ksh will read the unencrypted txt and try to run the commands.
# 3  
Old 03-02-2004
I just tried that Perdarabo it runs the command but wont use the results for some reason
Code:
  echo "                           [1]  Allow (LIVE) "
  echo "                           [2]  Deny (LIVE) "
  echo "                           [E]  Exit "
  echo ""
  if [ "${ERROR}" = "Y" -a  "${CHOICE}" != "" ]
  then
    ERROR="N"
    echo "            Your last entry was invalid. Please try again . . . ";
  else
    echo ""
  fi
  echo ""
  echo "                  Please Enter Your Choice  [ ]\b\b\c"
  read CHOICE
        case $CHOICE  in
        [1-2])
                case $CHOICE in
                 1)echo ""
echo "                You have allowed access to the live system"

THIS IS THE UNENCRYPTED CODE

#                       SID=LIVE
#                       CURR_PWD=whatever
#                       NEW_PWD=something else
#                       NEW_STATUS=ALLOW
#                    CURR_STATUS=`cat /export/home/troberts/status_LIVE`

THIS IS THE FILE
                        . ./tommy1 | ksh
                        ;;
                 2) echo ""
 echo "               You have denied access to the live system"

THE FILE CONTAINS SIMILAR CODE TO THIS SEE ABOVE
                      
                        SID=LIVE
                        CURR_PWD=something else
                        NEW_PWD=whatever
                        NEW_STATUS=DENY
                        CURR_STATUS=`cat /export/home/troberts/status_LIVE`
                        ;;
                 esac
echo""
echo "                    We are dealing with your request"
sleep 2
PATH=$PATH/bin:/usr/bin blah blah blah
export PATH
PATH=$PATH:/opt/blah blah blah blah/bin:.
export PATH
BASE_PATH=$PATH;export BASE_PATH

PATH=$BASE_PATH;export PATH
. /opt/bin/blah blah${SID}

BUT FALLS DOWN HERE 
                trap 2
        if [ "${CURR_STATUS}" != "${NEW_STATUS}" ]
         then
          sqlplus -s land/${CURR_PWD} @set_password ${NEW_PWD}
          echo ${NEW_STATUS} > /export/blah blah /status_${SID}
echo ""
echo ""
        echo "         You have chosen to change the status to the ${SID} system
"
        sleep 4
         else
          echo "         The status of the ${SID} system is already set to ${NEW
_STATUS} "
                sleep 5
        fi

        trap ""
        PATH=$BASE_PATH;export PATH
                continue ;;
      e|E) #
echo "You have requested to Exit back to the Main Menu"
        #
        CHOICE="E"
        continue ;;
    *)  #
        #     Invalid Choice Made
        #
        ERROR="Y";;
  esac
done
CHOICE="";export CHOICE

added code tags for (some) readability --oombera

Last edited by oombera; 03-03-2004 at 01:59 AM..
# 4  
Old 03-02-2004
Well, I have no idea what I'm looking at.

. ./tommy1

should work if the file tommy1 is really just commands. I did not see anything where it looked like tommy1 was being decrypted. To set environment viariables, you will need to dot command like that piping to ksh will not work.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Bootable Encrypted Backup

Is there a utility available to make such a backup? Is this idea even possible? Thanks for the help. (5 Replies)
Discussion started by: rwh2011
5 Replies

2. UNIX for Advanced & Expert Users

compile a c program in a encrypted way

Hi Guys, I wonder I had have a look to the cc compile options but I could be missing one but basically I'm compliling a c program where I will storing a command to connect to a database and also userid and password. The issue is that after the module is generated using a command like strings I... (14 Replies)
Discussion started by: arizah
14 Replies

3. Linux

Secured encrypted files via Linux

I need to encrypt a ".txt" file with password settings and it should decrypt the file automatoically when end user types correct password. Can some one help me on this. Thank you (3 Replies)
Discussion started by: rlmadhav
3 Replies

4. UNIX for Dummies Questions & Answers

how to run an ENCRYPTED file?

Hello sir, we are able to do : 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... (5 Replies)
Discussion started by: nsharath
5 Replies

5. UNIX for Dummies Questions & Answers

how to compare 2 encrypted files?

I have 2 files :- 1) f1.txt and f2.txt.Both contain some text as - 2)Now I did : output: I got them to be equal. 3) I encrypted them using gpg and with the SAME paraphrase :- 4)Now I did : #cmp f1.txt.gpg f2.txt.gpg (OR) #diff f1.txt.gpg f2.txt.gpg output: I got them to be... (1 Reply)
Discussion started by: nsharath
1 Replies

6. UNIX for Dummies Questions & Answers

How to unzip multiple files (encrypted) in a directory.

Good day all. I want to unzip multiple files in a directory. Suppose there are two files: test.txt.zip and test1.txt.zip Using this command: unzip -o -P test*.zip results in the unzipping of the first file not second. It gives this error: Archive: test.txt.zip caution: filename not... (2 Replies)
Discussion started by: er_ashu
2 Replies

7. Shell Programming and Scripting

executing an encrypted script

Can we execute an encrypted shell script . I encrypted a shell scripts with crypt with keys and tried to execute it it gave me segmentation faul?? Can somebody answer this one please?? If we can is there any settings i need to change?? Thanks (2 Replies)
Discussion started by: ajnabi
2 Replies

8. UNIX for Advanced & Expert Users

executing encrypted files

Hi, Is there a way of executing encrypted files? I have encrpyted files using vi and crypt, but when I execute the encrypted file, it takes the contents literally (special characters, junk - encrpyted format). Kind Regards, Kawah (4 Replies)
Discussion started by: Kawah Cheung
4 Replies

9. UNIX for Dummies Questions & Answers

executing encrypted files

Hi, Is there a way of executing encrypted files? I have encrpyted files using vi and crypt, but when I execute the encrypted file, it takes the contents literally (special characters, junk - encrpyted format). Kind Regards, Kawah (1 Reply)
Discussion started by: Kawah Cheung
1 Replies
Login or Register to Ask a Question