Sponsored Content
Top Forums Shell Programming and Scripting Bash Script to decrypt encrypt log and archive Post 302559287 by cdc01 on Monday 26th of September 2011 04:06:46 PM
Old 09-26-2011
Bash Script to decrypt encrypt log and archive

Hi

Please see if you have come across any aprts of this. I can read, integrate and syntehsixe. Any help you could offer me would be super. thanks in advance!


Good day.


Thank you for your response in this matter. Here are some further details:

1) scripting is to be in BASH shell programming

2) when targeting a named directory, based on filtering, we will need to:
a) identify the .pgp extension files present (there may be a timestamp before or after the .pgp)
b) archive the received file (.pgp)
c) decrypt the file using GPG (we have the priv key)
d) put the file back into the same directory and archive it as well
Log all activities, delete gpg file from directory only if successful in decrypting

3) when targeting another directory, we will need to
a) archive the file(s) pre-encryption. (based on location (file name) and then on extension
b) may or may not need to timestamp it
c) encrypt the files separately. Here: depending on the directory that the file is present it will be encrypted with a certain key
(a hierarchy of folders will be scanned)
d) may need to timestamp it here (not sure yet if timestamp is needed before or after encryption)
e) archive the encrypted files
f) be sure the new files are in the same directory as the original ones
g) delete the original files from the directory (this may be done by GPG but im not sure), but only delete if the encryption was successful
h) may need to change the rights of the new file
i) log all steps performed or failed on.


4) For each of the archivings done, every week (MON 00:01) a new tarball should be created. Not sure progamatically
what is simpler, but weekly or some like variation (ideally start new MON 00:01 AM) may be the best

As well, it is important to check that the file is not in use when going to encrypt it, or decrypt it.
Not sure what method is best to verify if the file is in use, but this should be checked as well.

thanks for your help in advance!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Encrypt & Decrypt a String

Hi Everybody, I have a script that telnet another system. For some reasons, this is should be done by "root", so the root password has been written explicitly in this script, which mean any body read this script will know the root password of the other system. I think the solution is to write... (6 Replies)
Discussion started by: aldowsary
6 Replies

2. Shell Programming and Scripting

encrypt and decrypt password

how do i encrypt and decrypt a password (2 Replies)
Discussion started by: sanwish
2 Replies

3. Shell Programming and Scripting

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 (9 Replies)
Discussion started by: shary
9 Replies

4. Shell Programming and Scripting

How to encrypt and decrypt a file

How to encrypt and decrypt a file using unix Command? Can any one help me? (2 Replies)
Discussion started by: laknar
2 Replies

5. Shell Programming and Scripting

Encrypt and decrypt a string

Hi, I want to encrypt and decrypt a string(database password) which will be used in my scripts. encrypt the string while storing in a file and while using it in other scripts it should decrypt. i tried below method. As it can decrypt easily, it is not recommended. encrypt=`perl -e 'print unpack... (5 Replies)
Discussion started by: rohan10k
5 Replies

6. Shell Programming and Scripting

Encrypt and Decrypt

I have script for all oracle prod db. I have hard coded the username / password. I need a mechanism to encode and decode the username / password in a shell script. Another challenge is I use the username and password in a Select command for oracle DB. How can call the decrypted... (2 Replies)
Discussion started by: ilugopal
2 Replies

7. Shell Programming and Scripting

Encrypt Password file and decrypt in a shell script

Hi All, I have stored Oracle database passwords in a hidden file - .pass_file. My shell script reads the hidden file, gets the password and then logs in to the Oracle database and runs some SQL script. My requirement is: I need to provide the shell script to be executed by someone else. So,... (1 Reply)
Discussion started by: sunpraveen
1 Replies

8. Shell Programming and Scripting

Encrypt and decrypt a password in shell script

Hi All, very good morning all. I am trying to connect to informatica repository by using shell script. I have written pmrep connect command in the script file. But i need to provide repository, domain ,username and password to connect. Username and password are hard coded in the script... (8 Replies)
Discussion started by: SekhaReddy
8 Replies

9. Shell Programming and Scripting

Encrypt and decrypt the password in a Shell Script

Hello, I have the following UNIX shell script which connects to the teradata database and executes the SQL Queries. For this, I am passing database name, username and password. I don't want to reveal my password to anyone. So, is there any way that I can encrypt my password and read the... (2 Replies)
Discussion started by: ronitreddy
2 Replies

10. UNIX for Beginners Questions & Answers

Encrypt and Decrypt a File with Password

Hello, I have few files on unix which are payroll related and I need them to encrypt with password so others wouldn't see the data. I use ETL tool and would like to know the unix command that does encryption/decryption to use in the ETL. Thank you, Sri (3 Replies)
Discussion started by: eskay
3 Replies
zipcloak(1)						      General Commands Manual						       zipcloak(1)

NAME
zipcloak - encrypt entries in a zipfile SYNOPSIS
zipcloak [-d] [-b path] [-h] [-v] [-L] zipfile ARGUMENTS
zipfile Zipfile to encrypt entries in OPTIONS
-b path --temp-path path Use the directory given by path for the temporary zip file. -d --decrypt Decrypt encrypted entries (copy if given wrong password). -h --help Show a short help. -L --license Show software license. -O path --output-file zipfile Write output to new archive zipfile, leaving original archive as is. -q --quiet Quiet operation. Suppresses some informational messages. -v --version Show version information. DESCRIPTION
zipcloak encrypts all unencrypted entries in the zipfile. This is the default action. The -d option is used to decrypt encrypted entries in the zipfile. zipcloak uses original zip encryption which is considered weak. Note: The encryption code of this program is not copyrighted and is put in the public domain. It was originally written in Europe and can be freely distributed from any country including the U.S.A. (Previously if this program was imported into the U.S.A, it could not be re-exported from the U.S.A to another country.) See the file README.CR included in the source distribution for more on this. Otherwise, the Info-ZIP license applies. EXAMPLES
To be added. BUGS
Large files (> 2 GB) and large archives not yet supported. Split archives not yet supported. A work around is to convert the split archive to a single-file archive using zip and then use zipcloak on the single-file archive. If needed, the resulting archive can then be split again using zip. SEE ALSO
zip(1), unzip(1) AUTHOR
Info-ZIP v3.0 of 8 May 2008 zipcloak(1)
All times are GMT -4. The time now is 05:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy