Sponsored Content
Top Forums Shell Programming and Scripting Trying to perform encryption through script Post 302392104 by simi28 on Wednesday 3rd of February 2010 10:54:47 AM
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...
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Test::Script(3) 					User Contributed Perl Documentation					   Test::Script(3)

NAME
Test::Script - Basic cross-platform tests for scripts DESCRIPTION
The intent of this module is to provide a series of basic tests for 80% of the testing you will need to do for scripts in the script (or bin as is also commonly used) paths of your Perl distribution. Further, it aims to provide this functionality with perfect platform-compatibility, and in a way that is as unobtrusive as possible. That is, if the program works on a platform, then Test::Script should always work on that platform as well. Anything less than 100% is considered unacceptable. In doing so, it is hoped that Test::Script can become a module that you can safely make a dependency of all your modules, without risking that your module won't on some platform because of the dependency. Where a clash exists between wanting more functionality and maintaining platform safety, this module will err on the side of platform safety. FUNCTIONS
script_compiles script_compiles( 'script/foo.pl', 'Main script compiles' ); The "script_compiles" test calls the script with "perl -c script.pl", and checks that it returns without error. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. Note also that the test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. script_runs script_runs( 'script/foo.pl', 'Main script runs' ); The "script_runs" test executes the script with "perl script.pl" and checks that it returns success. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. The test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. SUPPORT
All bugs should be filed via the bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Script> For other issues, or commercial enhancement and support, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
prove, <http://ali.as/> COPYRIGHT
Copyright 2006 - 2009 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.3 2009-11-24 Test::Script(3)
All times are GMT -4. The time now is 02:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy