Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Syntaxt to zip a file with password protection Post 302227253 by veeru4all on Wednesday 20th of August 2008 11:51:31 PM
Old 08-21-2008
Syntaxt to zip a file with password protection

Hi Experts,

I am an SAP ABAP developer and compleatly stranger to unix and I need a help to extend a small peice of code.

Our requirement is to zip a file with password protection in a specified directory. Following is the code I am using to zip a file ZZZZ.TXT.

Here YYYY = is the path where the file is stored.
ZZZZ is the name of the file.

cd /YYYY;zip -r ZZZZ.zip ZZZZ.TXT

Please let me know the syntax to create the zip file with password protection. I saw some where that we can use "-P password" to make the zipfile password protected, but I am not sure where/how exactly it can be used within the above syntax. Although -P is not safe, it is OK with us, as we are triggering this command from SAP.

This is quite urgent for us.

Thanks in advance.
Veerendranath Maddula.


 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Does unix has password protection for zip files?

How to set password in zip files under unix? There are password protection available in various os. Does unix has password protection for zip files? Is zip and gzip command has it? (6 Replies)
Discussion started by: p_prathaban
6 Replies

2. AIX

File password protection/encryption

Can it be done? Ive read in a few places that the crypt program no longer exists on AIX...if its do-able please tell me how. (2 Replies)
Discussion started by: rdudejr
2 Replies

3. UNIX for Dummies Questions & Answers

Zip file with password protection

I am trying to zip a file with password protection. I have read all or atleast most of the threads on the website, but couldn't come up with a solution. I am running ZIP version 2.3 on HP-UX but I dont see the -P (password) option. I read somewhere that free versions of zip don't come with... (5 Replies)
Discussion started by: pintu
5 Replies

4. Shell Programming and Scripting

Password protect a zip file

Hi, I'm working on Solaris 9 and i need to unzip a password protected zip, which i can do using zip -Ppassword filename however when i have done what i need to do with the file is to zip the file back up with a password. Zip on my system is version 2.3 and does not support this? How can... (0 Replies)
Discussion started by: Pablo_beezo
0 Replies

5. AIX

How to zip file in AIX with password.

Hi Guru, I have assignment to create script to compress file as .ZIP with password. I don't know the command line in AIX. It's very new for me. I'm try to use zip or tar but I don't have any option for encrypt with password. Please kindly suggest me. Thank you very much. Multidev (7 Replies)
Discussion started by: multidev
7 Replies

6. Shell Programming and Scripting

Password Protection using Term::ReadKey

Hi Friends, I execute a perl script with password as input but i wish not to print the password when i give the input. Instead when i provide the password it could be shown as "****" instead of original password. I know we can use Term::ReadKey or IO::Prompt for this, but just wanted to know if... (0 Replies)
Discussion started by: nmattam
0 Replies

7. Shell Programming and Scripting

uuencode - .csv file password protection

HI, Can we add password protection for attachment of .CSV file in below command or any alternative solution. uuencode ../reports/gtsa_lmt_pb_rfs_daily.txt gtsa_lmt_pb_rfs_daily-$FILDTE.csv |mailx -s "gtsa_lmt_pb_rfs_daily" $MAILTO Many thanks regards, Sampath (4 Replies)
Discussion started by: Sampath.Rachcha
4 Replies

8. Shell Programming and Scripting

Password protection in unix

How to create a file in UNIX which is password protected ? Thanks and Regards, Neeraj (5 Replies)
Discussion started by: neeraj617
5 Replies

9. UNIX for Dummies Questions & Answers

password protect a CSV file: better solution than ZIP password?

Hi We send *.csv with sensitive data to our customers. Our customers open those files with Excel. A new requirement is that we password protect those CSV files. I thought to pack them with ZIP and assign a password to the archive. But Solaris 10 can't encrypt ZIP files. $ zip -P... (12 Replies)
Discussion started by: slashdotweenie
12 Replies

10. UNIX for Dummies Questions & Answers

Zip a file with password

Hi, newbie to Linux, is there another way to zip a file with a password other than using 'zip' command? (7 Replies)
Discussion started by: mined
7 Replies
ZIP_FOPEN_ENCRYPTED(3)					     Library Functions Manual					    ZIP_FOPEN_ENCRYPTED(3)

NAME
zip_fopen_encrypted , - .Nm zip_fopen_index_encrypted open encrypted file in zip archive for reading LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> struct zip_file * zip_fopen_encrypted(struct zip *archive, const char *fname, int flags, const char *password); struct zip_file * zip_fopen_index_encrypted(struct zip *archive, zip_uint64_t index, int flags, const char *password); DESCRIPTION
The zip_fopen_encrypted function opens the encrypted file name fname in archive using the password given in the password argument. The flags argument are the same as for zip_fopen(3). The zip_fopen_index_encrypted function opens the file at position index, see zip_fopen_index(3). These functions are called automatically by zip_fopen(3); you only need to call them if you want to specify a non-default password (see zip_set_default_password(3) ). RETURN VALUES
Upon successful completion, a struct zip_file pointer is returned. Otherwise, NULL is returned and the error code in archive is set to indicate the error. ERRORS
[ZIP_ER_NOPASSWD] No password was provided. The function zip_fopen_encrypted may also fail and set for any of the errors specified for the routine zip_fopen(3). The function zip_fopen_index_encrypted may also fail and set for any of the errors specified for the routine zip_fopen_index(3). SEE ALSO
libzip(3), zip_fclose(3), zip_fopen(3), zip_fread(3), zip_get_num_entries(3), zip_name_locate(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH February 14, 2011 ZIP_FOPEN_ENCRYPTED(3)
All times are GMT -4. The time now is 07:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy