Trying to perform encryption through script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Trying to perform encryption through script
# 1  
Old 02-03-2010
Trying to perform encryption through script

Hi,

I have a small basic script encryption.sh as shown below. All I am trying to do is to encrypt a file which is passed through the script.
It works fine when I execute this script directly from command line via putty or telnet but it does not work when I call this script in an application(informatica) and run it from there. The script is running fine when executed via an application but it is not performing the encryption part.

Script: encryption.sh

Code:
#!/bin/ksh
FILEDIR="/test/INT/targetdata"
FILENAME="/test/INT/targetdata/test_20100129"
 
# Encryption Key
KEYNAME="test"
 
cd $FILEDIR
/opt/iexpress/gnupg/bin/gpg -e -r $KEYNAME $ FILENAME


This part works when I execute the encryption.sh script directly from command line but does not work when I run this script through an application(though it executes fine from application but does not perform the encryption process.)


This is what I get when I run it through command line it gives some warning but encrypts the file successfully. Unix admin says we can ignore the warning.

Code:
/test> encryption.sh
gpg: WARNING: using insecure memory!
gpg: please see http://www.gnupg.org/faq.html for more information



Please advice.

Thanks

Last edited by pludi; 02-03-2010 at 12:01 PM.. Reason: code tags, please...
# 2  
Old 02-03-2010
can you log the output of stderr when the program runs it? that may be useful.
# 3  
Old 02-03-2010
Logs are not generated

Quote:
Originally Posted by Corona688
can you log the output of stderr when the program runs it? that may be useful.
I tried writing the above script to a log something like below. But it generates a 0 byte log file and does not write anything to it.

cd $FILEDIR
/opt/iexpress/gnupg/bin/gpg -e -r $KEYNAME $ FILENAME >> test.log

Thanks
Simi
# 4  
Old 02-03-2010
That's logging stdout, not stderr. At least we've proved its actually reaching that line though! Try 2>>.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Cybersecurity

File encryption tools with MAC address as an encryption key

Hi all, I'm looking for secure file encryption tools that use MAC address as encryption key. FYI, I'm using Red Hat Enterprise Linux OS. For example: when A wants to send file to B A will encrypt the file with B's computer MAC/IP address as an encryption key This file can only be decrypted... (2 Replies)
Discussion started by: sergionicosta
2 Replies

2. Shell Programming and Scripting

Unix Script -- Unable to perform division

I'm new to scripts, i wrote the below script to capture the percentage of FreeMemory available in Linux box. Output of UsedfreeMemory is displayed as '0'. I'm expecting the output like 0.89 (or) .89 --- ( 0.89 perferable) Anyone can help me on this pls. ... (3 Replies)
Discussion started by: murali1687
3 Replies

3. Linux

Pgp encryption script

I have file in linux which I need to do the PGP encryption. Through manually I am using this command to do the same gpg -c scsrun.log Enter passphrase : Repeat Passphrase : But how I can achive this using linux script. Thanks How to use code tags (3 Replies)
Discussion started by: mr_harish80
3 Replies

4. Shell Programming and Scripting

Script to perform record format checks

Hi All, I have a requirement to perform the following checks. Input file is a "|" delimited file and looks like this. A|c1|c2|c3|.... B|G1|G2|G3.... C|H1|H2|H3... A|c4|c5|c6|.... B|G4|G5|G6.... C|H4|H5|H6... Now the check is to see if all the "A" records have a corresponding B... (7 Replies)
Discussion started by: gsjdrr
7 Replies

5. Solaris

Password encryption in script

:DHi i am preparing a script to connect to oracle from solaris.... now i want that no one is able to see the password in the script. is it possible...please help Regards Ankurk (3 Replies)
Discussion started by: ankurk
3 Replies

6. AIX

Script to perform some actions on multiple files

I have this Korn script that I wrote (with some help) that is run by cron. I basically watches a file system for a specific filename to be uploaded (via FTP), checks to make sure that the file is no longer being uploaded (by checking the files size), then runs a series of other scripts. The... (2 Replies)
Discussion started by: heprox
2 Replies

7. UNIX for Dummies Questions & Answers

File encryption/Key encryption ????

My dilemma, I need to send, deemed confidential, information via e-mail (SMTP). This information is sitting as a file on AIX. Typically I can send this data as a e-mail attachment via what we term a "mail filter" using telnet. I now would like to somehow encrypt the data and send it to a e-mail... (1 Reply)
Discussion started by: hugow
1 Replies

8. Solaris

script encryption

hi all , i have a script that is written in ksh , i was wondering if there is a method or a command that can be used to encrypt the script and still make it execuable . i am running solaris 9 on SPARC . thanks (3 Replies)
Discussion started by: ppass
3 Replies

9. Shell Programming and Scripting

encryption script

I am encrypting and ftping files with kshell from aix and I have a problem with the job not waiting long enough before it ftps the files. when I run the script it sends the files over and each time the file has a different length and cannot be decrypted but if I encrypt and the manually send the... (3 Replies)
Discussion started by: tdavis0418
3 Replies
Login or Register to Ask a Question