Zip file with password using an applescript

Hi all;
I want zip a file with a password using an apple script. The problem is that I'll run the command
zip -ejr outfile infile
but how do I submit the password to the terminal?
I don't want the terminal to be visible during the process so I'm using this command:
tell application "Terminal" to do shell script sh
where sh is the command I want to run.
Thank you!

I'm running out of suggestions over here.
Your exact command line yields this result:
zip warning: name not matched: in.txt
zip error: Nothing to do! (out.zip)
Well, it should, as I don't have an in.txt. Handing it an existing file, I get this:
zip -P pass out.zip result.txt
  adding: result.txt (deflated 7%)
.. and opening in the Finder correctly prompts me:
so there must be something wrong with your system.
Very Long Shot: What version do you get when you type this? (I can't imagine this is the actual problem, but you never know.)
zip --version
Mine is
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.  Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.
Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
as of above date; see http://www.info-zip.org/ for other sites.
Compiled with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) for Unix (Mac OS X) on May 25 2011.

Similar Messages

  • Decompress ZIP file with Password

    Hi all,
    Does anybody know how to decompress a ZIP file with password protection?
    I have a decompress code, but I don't know how to insert the pass.
    Any solution?
    Regards

    I'm running out of suggestions over here.
    Your exact command line yields this result:
    zip warning: name not matched: in.txt
    zip error: Nothing to do! (out.zip)
    Well, it should, as I don't have an in.txt. Handing it an existing file, I get this:
    zip -P pass out.zip result.txt
      adding: result.txt (deflated 7%)
    .. and opening in the Finder correctly prompts me:
    so there must be something wrong with your system.
    Very Long Shot: What version do you get when you type this? (I can't imagine this is the actual problem, but you never know.)
    zip --version
    Mine is
    Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
    This is Zip 3.0 (July 5th 2008), by Info-ZIP.
    Currently maintained by E. Gordon.  Please send bug reports to
    the authors using the web page at www.info-zip.org; see README for details.
    Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
    as of above date; see http://www.info-zip.org/ for other sites.
    Compiled with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) for Unix (Mac OS X) on May 25 2011.

  • Zip files with passwords

    I recently created a zip file from a folder with photos. When I send this via email the recipients cannot open the file it ask for a password. I thought maybe it was because the recipient was using windows but since I have parallels on my machine I thought I would pull the file over to parallels windows and it refuses to do it. Any one have an idea that will help. I am new to the mac operating system.

    No I did not create a password and yes there is the .zip extension.
    I zipped the file due to the number of photos in the folder. My mac mail program only lets you attach photos individually and there was quite a few photos to send.
    What I don't get is why I cant drag a photo file into windows parallels. Each time i get a message saying it "cant copy the file: cannot read from source file or disk" this file is on my desktop on the mac side.

  • Zip file with password

    Good morning for everybody!!
    I have a code that creates a zipe file. What should I do with this code to implement that functionality of Winzip with password?
    Does anybody have any idea??
    Thanks in advance!!
    Gin

    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4347142
    It seems that this was raised as a request for enhancement and this still shows as "in progress". But I'm pretty sure that there is no progress on this issue. What you could do is, go through the links posted in there regarding the zip file format and write your own classes.

  • C# Protect file with password

    Hello,
    I am creating a notepad where you can protect a file with an password. Try to imagine it as a protected .zip file with username and password, but in this case it's about an text file with a other file extension (.cpd). I tried a lot of codes, but they don't
    work. So the question to you guys is: How do i protect a text file (or .cpd file) with C#?
    I created the form with the username textBox and the password textBox (+ the login button)
    I have experience with C#, but i stay an beginner
    Thanks,
    Hugo Woesthuis

    how do i make the text file in an other coding, so no one can read the text  in Notepad, Word , etc
    Hi,
    Here is an example:
    private void button_Click(object sender, EventArgs e)
    //Filename
    string _filename = @"C:\test\testfile.txt";
    //Write data to file
    FileIO.WriteEncryptedFile(_filename, "HELLO");
    //Read data from file
    System.Console.WriteLine("File content: " + FileIO.ReadEncryptedfile(_filename));
    File input / output class:
    public class FileIO
    public static void WriteEncryptedFile(string filename, string data)
    using (StreamWriter _streamWriter = new StreamWriter(filename, true))
    _streamWriter.Write(new Crypto().Encrypt(data));
    public static string ReadEncryptedfile(string filename)
    using (StreamReader _streamReader = new StreamReader(filename))
    return new Crypto().Decrypt(_streamReader.ReadToEnd());
    Encryption / decryption class:
    class Crypto
    byte[] _key { get; set; }
    byte[] _iv { get; set; }
    public Crypto()
    _key = Encoding.Default.GetBytes("ABCDEFGHIJKLMNOP");
    _iv = Encoding.Default.GetBytes("ABCDEFGHIJKLMNOP");
    public string Encrypt(string data)
    using(ICryptoTransform _iCrypto = new TripleDESCryptoServiceProvider().CreateEncryptor(_key, _iv))
    var _byteData = Encoding.Default.GetBytes(data);
    var _encryptedData = _iCrypto.TransformFinalBlock(_byteData, 0, _byteData.Length);
    return Convert.ToBase64String(_encryptedData, 0, _encryptedData.Length);
    public string Decrypt(string data)
    using (ICryptoTransform _iCrypto = new TripleDESCryptoServiceProvider().CreateDecryptor(_key, _iv))
    var _byteData = Convert.FromBase64String(data);
    var _decryptedData = _iCrypto.TransformFinalBlock(_byteData, 0, _byteData.Length);
    return Encoding.Default.GetString(_decryptedData);
    Remember to change the key and IV in the constructor of the Crypto class, key must be between 16-24 characters long.

  • Decrypt Zip File with 128bit AES

    Hello my name is George ,
    I want to make a program to decrypt a zip file with 128-bit AES Algorithm using Brute Force and Dictionary Attack.
    Because it is my first time I try to make something with the encrytpion libraries I don't know much.
    Because that is an exercise they told us to use this library [http://www.javamex.com/arcmexer/].
    So I want to give me some help.
    Any help is welcoming.

    Hi.
    I want to make a program to read a zip file with a password(aes encrytpion) and I foun the password.
    At first i know the password and I want to do If I write it wright.
    I read a zip file but when I try to read it with encryption I take that exception.
    That is the program
    import com.javamex.arcmexer.*;*
    *import java.io.*;
    import java.lang.*;*
    *import java.util.*;
    public class Decryption {
         public static void main(String[] args){
              String pw = "12345678";
              System.out.print("\rEnter the filename to be encrypted (full path is needed if not located at the same directory): ");
                    try {
                   FileInputStream f = new FileInputStream("C://Giorgos.zip");
                   ArchiveReader r = ArchiveReader.getReader(f);
                   ArchiveEntry entry =r.nextEntry();     
                   BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
                            while ((entry = r.nextEntry())!= null) {
                        String filename = entry.getFilename();
                                    InputStream in = entry.getInputStream();
                                    String inputLine = input.readLine();
                                    if (inputLine.equalsIgnoreCase("yes")) {
               +BufferedReader br = new BufferedReader(new InputStreamReader(entry.getInputStream(filename)));+  //HERE IS MY PROBLEM
                                        +String line;+
                                         +while ((line = br.readLine())!= null) {+
                                        +System.out.println(line);+
    <                                    <em>input.close();+
    <                       <em>// }+
    +               if (entry.isProbablyCorrectPassword(pw)){+
    +                    System.out.println("Password found: "+  pw);
              } catch (Exception e){
                        System.out.println("Exception raised!");
    }And the exception is:
    *{color:#0000ff}C:\Documents and Settings\Ergasia\Decryption\src\Decryption.java:26: getInputStream() in com.javamex.arcmexer.ArchiveEntry cannot be applied to (java.lang.String)*
    *BufferedReader br = new BufferedReader(new InputStreamReader(entry.getInputStream(filename)));{color}*

  • PI needs to obtain a zip file via FTP using the File adapter

    I have a scenario where PI needs to obtain a zip file via FTP using the File adapter, this zip file contains a number of txt files that I need to process, and the content of one of them send it to an ECC, now I'm using the PayloadZipBean Module in the Sender FIle Adapter, and I have two things if I use the Message Protocol as File, I get a Payload for each txt file in the zip file, but this payload has no structure, and if I use the File Content Conversion I get an XML strcuture with only one field and a strange string in it, and somewhere in this string the names of the files I assume all the content of the zip file, can anyone help on how could I achieve what I need that is to pull the zip file via SAP PI, then unzip it, and with the content of one of the txt files send it to an ECC via ABAP Proxy, thanks in advance for your answers.
    Regards,
    Raul Alvarado

    Hello Raul,
    you can do it in futher way ...
    pickup zip file and simply extract and dump it in another temp folder (can use scripts on OS level).
    @ then Use another sender communication channel to pickup all these text file .
    for further clarification you can use these links also. -
    Process txt files in zip file
    Accessing File using FTP from Java Mapping
    File Sender Adapter with FTP protocol
    BR
    Raj

  • How to open an excel file with password in Crystal Reports XI  Release 2

    I have a problem when i try to open an excel 2003 file with password that i know
    i recevived an error code 0xc59
    How can I open a file in excel 2003 protected by password to create the report?
    Thanks in advanced

    Hi Pierluigi,
    It looks like you have to open the excel file and use the data.
    A few informative links.
    http://support.microsoft.com/kb/257819#RetrieveExcel
    http://support.microsoft.com/kb/211378/EN-US/
    Hope this helps.
    Regards,
    Abhijeet Taskar.

  • Decrypt Zip File with AES Cryptography

    Hi,
    I want to make a programm to decrypt a zip file with aes cryptography in java with gui.
    Our professor as a help they gave us that code [http://code.google.com/p/winzipaes/source/browse/winzipaes/src/de/idyl/crypto/zip/AesZipFileDecrypter.java?r=4].
    I search in Internet to find out same help for the project but I understood , that other programm don't use all the packages in the example.And i am little confused.
    I want some help to find out a solution for this problem.And if you have a similar programm jusy sent it to occupy how I resolve my own problem.

    As your professor has given you the crypto code and wants you to write the GUI code this is not a Cryptography question at all. Locking this thread.

  • How do I view ipod music files with out using I tunes?

    I trying to view my Ipod music files without using itunes. But when I conect my Ipod to my pc I can only view contacts, notes, and caladar through the driver.
    How do I view ipod music files with out using I tunes?

    they should be under ur my music folder if u have windows

  • I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it.

    I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it. All of the files are going into the same zip file but I want them visually in the space that I put them and not at the bottom of the snap to grid folder location they are looking like.  I am trying to  drag and drop files in groups so that I can group them for now, but image files always do their own "sort by" when I drag them from my web pages. Links don't do it though.  I tried resetting the folder, and deleting the DS files. No luck.

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

  • I can't open a PDF file with password with my iphone app

    I can't open a PDF file with password with my iphone app, the app send me an error, but the password is correct. This only happend in the new version of iphone. In the latest version I didn't have this problems.

    Can you please share the file with us at [email protected]? Also, can you please confirm that you are viewing the PDF in the Adobe Reader app rather than an app like dropbox, Mail or Safari?

  • Error when Connect to Access 2007 with password using OLEDB

    Hi there,
    I am seeing the below error when trying to Connect to Access 2007 with password using Crystal XI or Crystal 2008, when using the OLEDB to connection Access data.
    Logon failed
    Details: DAO Error Code: 0xd0f
    Source: DAO.Workspace
    Description: Unrecognised database format 'path to database\crs project database.aaadb
    Get though when I use Access 2007 without password setup.
    Many Thanks for any one can help.
    Daphne Li

    As a copy of this query has been posted to the CR design forum at 11:21, assuming this is indeed a design question.
    Thus setting this thread as answered.
    - Ludek

  • How To Split File In to Multiple Files With out using B.P.M

    Hi Guys,
    How To Split File In to Multiple Files With out using B.P.M.
    Thanks in advance
    Regards's
    KIran.B

    Hello
    below r the links were u will find message spilitting by graphicaaly i.e without using BPM.
    /people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
    Sender File Adapter with file conversion  Multimapping --file content conversion with split messg mapping
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2748---- [original link is broken] [original link is broken] [original link is broken]
    multimappig
    /people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi
    hope this resolve your problem
    thank's
    Chetan

  • Cannot extract Zip file with Winzip after zipping with java.util.zip

    Hi all,
    I write a class for zip and unzip the text files together which can be zip and unzip successfully with Java platform. However, I cannot extract the zip file with Winzip or even WinRAR after zipping with Java platform.
    Please help to comment, thanks~
    Below is the code:
    =====================================================================
    package myapp.util;
    import java.io.* ;
    import java.util.TreeMap ;
    import java.util.zip.* ;
    import myapp.exception.UserException ;
    public class CompressionUtil {
      public CompressionUtil() {
        super() ;
      public void createZip(String zipName, String fileName)
          throws ZipException, FileNotFoundException, IOException, UserException {
        FileOutputStream fos = null ;
        BufferedOutputStream bos = null ;
        ZipOutputStream zos = null ;
        File file = null ;
        try {
          file = new File(zipName) ; //new zip file
          if (file.isDirectory()) //check if it is a directory
         throw new UserException("Invalid zip file ["+zipName+"]") ;
          if (file.exists() && !file.canWrite()) //check if it is readonly
         throw new UserException("Zip file is ReadOnly ["+zipName+"]") ;
          if (file.exists()) //overwrite the existing file
         file.delete();
          file.createNewFile();
          //instantiate the ZipOutputStream
          fos = new FileOutputStream(file) ;
          bos = new BufferedOutputStream(fos) ;
          zos = new ZipOutputStream(bos) ;
          this.writeZipFileEntry(zos, fileName); //call to write the file into the zip
          zos.finish() ;
        catch (ZipException ze) {
          throw ze ;
        catch (FileNotFoundException fnfe) {
          throw fnfe ;
        catch (IOException ioe) {
          throw ioe ;
        catch (UserException ue) {
          throw ue ;
        finally {
          //close all the stream and file
          if (fos != null)
         fos.close() ;
          if (bos != null)
         bos.close();
          if (zos != null)
         zos.close();
          if (file != null)
         file = null ;
        }//end of try-catch-finally
      private void writeZipFileEntry(ZipOutputStream zos, String fileName)
          throws ZipException, FileNotFoundException, IOException, UserException {
        BufferedInputStream bis = null ;
        File file = null ;
        ZipEntry zentry = null ;
        byte[] bArray = null ;
        try {
          file = new File(fileName) ; //instantiate the file
          if (!file.exists()) //check if the file is not exist
         throw new UserException("No such file ["+fileName+"]") ;
          if (file.isDirectory()) //check if the file is a directory
         throw new UserException("Invalid file ["+fileName+"]") ;
          //instantiate the BufferedInputStream
          bis = new BufferedInputStream(new FileInputStream(file)) ;
          //Get the content of the file and put into the byte[]
          int size = (int) file.length();
          if (size == -1)
         throw new UserException("Cannot determine the file size [" +fileName + "]");
          bArray = new byte[(int) size];
          int rb = 0;
          int chunk = 0;
          while (((int) size - rb) > 0) {
         chunk = bis.read(bArray, rb, (int) size - rb);
         if (chunk == -1)
           break;
         rb += chunk;
          }//end of while (((int)size - rb) > 0)
          //instantiate the CRC32
          CRC32 crc = new CRC32() ;
          crc.update(bArray, 0, size);
          //instantiate the ZipEntry
          zentry = new ZipEntry(fileName) ;
          zentry.setMethod(ZipEntry.STORED) ;
          zentry.setSize(size);
          zentry.setCrc(crc.getValue());
          //write all the info to the ZipOutputStream
          zos.putNextEntry(zentry);
          zos.write(bArray, 0, size);
          zos.closeEntry();
        catch (ZipException ze) {
          throw ze ;
        catch (FileNotFoundException fnfe) {
          throw fnfe ;
        catch (IOException ioe) {
          throw ioe ;
        catch (UserException ue) {
          throw ue ;
        finally {
          //close all the stream and file
          if (bis != null)
         bis.close();
          if (file != null)
         file = null ;
        }//end of try-catch-finally
    }

    Tried~
    The problem is still here~ >___<
    Anyway, thanks for information sharing~
    The message is:
    Cannot open file: it does not appear to be a valid archive.
    If you downloaded this file, try downloading the file again.
    The problem may be here:
    if (fos != null)
    fos.close() ;
    if (bos != null)
    bos.close();
    if (zos != null)
    zos.close();
    if (file != null)
    file = null ;
    The fos is closed before bos so the last buffer is not
    saved.
    zos.close() is enough.

Maybe you are looking for

  • My iTunes is not opening, i have tried EVERYTHING! please help...

    Everytime I click on iTunes, nothing happens. I uninstalled it and installed it again many times and it still doesnt open. PLEASE HELP!!!!!!

  • Internal orders

    Dear Friends, Internal orders: in relation to incident INC000001710365 there is a question open concerning future cleaning of the worklist. Setting a deletion flag on a specific record which should be deleted the system response is that this cannot b

  • Using iGlobe speakers with newer iMac

    I am so happy with may new iMac, but I thind maybe the speakers that came with my old iGlobe 700 Mhz were better than the internal ones in the nex one. However they have some strange plug that doesn't fit with the contact for earphones. Does anybody

  • Why my screen is too dim to see anything?

    As the title, and it seems that all other parts works well. Plus, helped by a external strong light, i tried to turn off the auto-brightness, and it did not work too. Please help me. thank you so much!

  • The effects between changing slides.

    Hello, I'm AD in a project where we are building a simulation experience. It will be done with two big screens and will be build in a shape of a corner. The simulation will be about future transportation and roads. In the corner will be a person who