Java zip password

Does anyone know how to create password protected zip files using Java API?
thanks in advance!
Jimmy

Is there anything stopping you from programming your
own method to encrypt your data ? Just curious if
you have looked into that possibility ? Granted I am
certain that time constraints are an issue for you.There's also the issue that he wants a standard password-protected ZIP and not some magic homegrewn stuff nobody else will be able to open.

Similar Messages

  • Java-administrator password keeps getting locked

    Hi,
    We have a portal 7.3 in which the Java-administrator password keeps getting locked. I can't see anything in the log traces in NWA. The only thing I've found is in security_audit logfile which doesn't really say much:
    #2.0 #2014 07 17 05:47:03:913#+0200#Info#/System/Security/Audit/PrincipalModification#
    #BC-JAS-SEC-UME#com.sap.security.core.sda#C000AC142D1F08D90000000000003284#52888950000000002#tc~bl~txmanager~plb#com.sap.security.core.util.SecurityAudit#Guest#0#JTA Transaction : 127261#040FAA9B0D6511E4C5A4000003270576#040faa9b0d6511e4c5a4000003270576#040faa9b0d6511e4c5a4000003270576#0#Thread[RMI/IIOP Worker [0],5,Dedicated_Application_Thread]#Plain##
    User account modified    | USERACCOUNT.MODIFY    | UACC.PRIVATE_DATASOURCE.un:Administrator    |     | SET_ATTRIBUTE: islocked=[true], SET_ATTRIBUTE: lockreason=[1]#
    Please advice,
    Thanks.

    Hi,
    there exists a trace location that should provide useful information for such cases. It is described in SAP note:
    1493272 - A user gets locked automatically
    My suggestion is add the location com.sap.security.core.userlocking as
    specified in the attachment to the note and once it is added, set that
    location to DEBUG and wait for the user to be locked again. Hopefully additional information concerning the origin of the bad credentials will be written to traces.
    Exactly how you capture the traces depends on the frequency in which
    the user becomes locked. For example if the user becomes locked every
    few minutes, after adding the location in the configtool and
    restarting the system, I suggest using the Security Troubleshooting
    Wizard to do so. Refer to note 1332726 - Troubleshooting Wizard and
    its attachments. Create a custom incident that is a copy of the
    Authentication incident and add this location
    com.sap.security.core.userlocking  to the newly created incident
    Set the wizard to use this new incident for trace collection and wait
    for the user to become locked. Then immediately stop the wizard's
    trace collection
    I
    f the locking occurs less frequently than every few minutes, it is
    preferable to use the NWA to adjust the severity of these locations
    and their sublocations to DEBUG and wait for the issue to reoccur
    com.sap.security.core.userlocking
    com.sap.engine.interfaces.security
    com.sap.engine.services.httpserver.HttpTraceRequest.traceRaw
    com.sap.engine.services.httpserver.HttpTraceResponse.traceHeaders
    com.sap.engine.services.security.authentication
    com.sap.security.core.logon
    com.sap.security.core.ticket
    com.sap.security.core.util
    com.sap.security.core.server.jaas
    See Log Configuration with SAP NetWeaver Administrator
    http://help.sap.com/saphelp_nw73/helpdata/en/47/af551efa711503e10000000a42189c/content.htm
    Don't forgot to change these back to default severity levels after the
    issue has captured in the traces
    Regards,
    David

  • I received a zip password protected file sent from a windows computer to my imac.  How do I unzip this file.  I keep getting an unavble to open, error 1 message/

    I received a zip password protected file from a windows user.  Can't seem to be able to open on my mac.  Getting an error 1 message "unable to open"
    Need instructions on how to open.  Thanks

    Get the free Stuffit Expander:
    http://www.stuffit.com/mac-expander.html

  • Zip Password

    Is it possible to make a password for a zip file using java code only?

    hi jmennen
    i now have a similiar requirement as the thraed initiator. from what you say, i understand that;
    the file could be any file and the encrpytion algol would set a password for this file. now if this is right and is done, will such a password be recognized by the zip file when user attempts to open it?
    if so could you give me a few pointers on how to go about it, because much as i need this feature, i an even more interested in implementing it as it seems highly interesting, if you could guide me somemore....
    thanks

  • A Problem about zip a Chinese File with Java Zip package

    Hi,
    my problem is following:
    I use "Java(1.3.1_02) Zip package" to compress some files into a zip File
    all thing is smooth except one:(
    If there is a fileName with Chinese (big5 encoding) characters
    it doesen't work!
    Can anyone tell me how to do?
    Thanks a lot!

    Hi !
    i do have a problem relating with the different character(korean).Hope u must be working with chinese characters.My problem is while displaying the korean characters from database , the characters are broken and not able to display on jsp pages.....
    Hope u can understand my problem.....
    Thanks....

  • How to avoid password prompt in shell script for zip password protection

    Hi
    I am trying to set password protection to my oracle database export backup. Once the backup completed, it should compress with a password protection. Thats the plan. Initialy we were using the gzip for the compression. Then realized that there is no password protection for the gzip. Started using zip option. I tried using
    zip -P <password> filename
    But it was throwing below error.
    -bash-3.2$ zip -P expreports REPORTS_2013FEB14.dmp
    zip warning: missing end signature--probably not a zip file (did you
    zip warning: remember to use binary mode when you transferred it?)
    zip warning: (if you are trying to read a damaged archive try -F)
    zip error: Zip file structure invalid (REPORTS_2013FEB14.dmp)
    Not quite sure why.
    Then I used zip -e REPORTS_2013FEB14.dmp.zip REPORTS_2013FEB14.dmp
    But this prompting for the password. As I am trying to put the command in the script. It will be tough if it prompts for the password.
    I would like to know how to avoid the password prompting by saving somewhere or how the code should be written. Tried using expect feature of shell script. Below was the code I tried. It didnt work.
    [oracle@SF40V6636 test]$ cat repexp.sh
    zip -e REPORTS_imp.log.zip REPORTS_imp.log
    expect "Enter password:"
    send "imprep"
    expect "Verify password:"
    send "imprep"
    So please help in avoiding this password prompt or let me know how to change the code.
    Thanks
    SHIYAS M

    How about using gpg and adding a secret key to the requirement of a password? No one should be able to decrypt your file, not by knowing only the password.
    1. Generate a public and private key pair:
    $ gpg --gen-key
    When it shows "We need to generate a lot of random bytes…" open another terminal session and type "dd if=/dev/sda of=/dev/null" to create traffic. When the public and secret key created and signed you can Ctrl-C the dd command.
    To see what you have created:
    $ gpg --list-keys
    2. Encrypt and gzip your stuff:
    $ tar zcf stuff.tgz file_or_folder
    $ gpg recipient "Some Name" encrypt stuff.tgz
    $ rm -f stuff.tgz
    3. Decrypt and extract the archive:
    $ gpg batch yes --passphrase "password" -d stuff.tgz.gpg > stuff.tgz
    $ tar zxvf stuff.tgz
    Again, knowing the password alone will not let anybody decrypt your stuff.

  • TutWD_EmailInteractiveForm_Init.zip password protected

    Hi,
    I am trying to start with a tutorial on offline interactive form based on sending and receiving emails and in this tutorial there is a reference to TutWD_EmailInteractiveForm_Init.zip that can be used as a starting point (it is a predefined web dynpro project template). I downloaded the zipfile but as soon as  try to unzip it I get a password popup for every file that is in the zip file. Final result: no template. Does somebody know how I can unzip this file?
    kind regards.
    Angelique Heutinck

    Hi Philip,
    My e-mail address is [email protected] Thank a lot in advance!
    kind regards,
    Angelique

  • Ora 10.2.0.4 Patch ZIP Password!

    I have just downloaded patch 8 (10204_Patch8_MSWIN-x86-64.zip) from the SAP website (https://websmp203.sap-ag.de/swcenter-3pmain) but it asks for a password to unzip! Ditto for patch 11 (10204_Patch11_MSWIN-x86-64.zip )
    Is it supposed to do that? How can I get the password?
    I checked the forums but no one seems to have encountered this problem! (+or am I typing the wrong keywords! +)

    Surprisingly, the zip file allows me view access to the files inside the archive!
    I circumvented my problem by copy-pasting the files from the archive without extracting them! Weird!
    I have completed the patching successfully.

  • Java - Zipping BLOB

    I have a table annotations (ann_annotation BLOB) which is becoming too large. That's why we opted for zipping the contents. For this purpose I have created (on Oracle 10i, JVM 1.5) 2 java-methods as follows:
    CREATE OR REPLACE JAVA SOURCE NAMED "ZipHandler" AS
    import java.lang.*;
    import java.sql.*;
    import oracle.sql.*;
    import java.io.*;
    import java.util.zip.*;
    import oracle.jdbc.*;
    public static BLOB Decompre(BLOB inBlob, Connection conn) throws Exception
    BLOB outBlob = BLOB.createTemporary(conn, false, BLOB.DURATION_SESSION);
    byte[] input = inBlob.getBytes();
    byte[] output = new byte[103090];
    int decompressedDataLength = 0;
    Inflater decompressor = new Inflater(true);
    decompressor.setInput(input);
    decompressedDataLength = decompressor.inflate(output);
    decompressor.end();
    OutputStream outstream = outBlob.getBinaryOutputStream();
    outstream.write(output,0, decompressedDataLength);
    outstream.close();
    return outBlob;     
    public static BLOB Compre(BLOB inBlob, Connection conn) throws Exception
    BLOB outBlob = BLOB.createTemporary(conn, false, BLOB.DURATION_SESSION);
    byte[] input = inBlob.getBytes();
    byte[] output = new byte[10000000];
    Deflater compressor = new Deflater(-1,true);
    compressor.setInput(input);
    compressor.finish();
    int compressedDataLength = compressor.deflate(output, 0, output.length);
    OutputStream outstream = outBlob.getBinaryOutputStream();
    outstream.write(output,0, compressedDataLength);
    outstream.flush();
    outstream.close();
    return outBlob;
    public static BLOB CompDecomp(BLOB inBlob,String test) throws Exception
    Connection conn = inBlob.getJavaSqlConnection();
    Statement stmt = conn.createStatement();
    BLOB blob = null;
    ResultSet rset = stmt.executeQuery("SELECT ann_annotation FROM annotations WHERE ann_id="+test);
    while(rset.next()){
    blob = Decompre(Compre(((OracleResultSet)rset).getBLOB("ann_annotation"), conn), conn);
    return blob;
    The 3rd method CompDecomp is just there to test if the resulting Zipped-Unzipped BLOBe is the same as the original. This is not the case. My original file = > 100000 bytes, the Zipped one is 59 (when I zip it with Winzip, the file is still > 100000, so the error relies somewhere in saving the result into the BLOB), and Unzipped it is 84 bytes.
    Strangly the following code gives back the original BLOB:
    public static BLOB CompDecomp(BLOB inBlob, String test) throws Exception
    BLOB ultoutBlob = BLOB.createTemporary(conn, false, BLOB.DURATION_SESSION);
    byte[] input = inBlob.getBytes();
    byte[] output = new byte[10000000];
    Deflater compressor = new Deflater();
    compressor.setInput(input);
    compressor.finish();
    int compressedDataLength = compressor.deflate(output);
    byte[] input2 = output; // which is directly a byte, not a BLOB
    byte[] output2 = new byte[10000000];
    int decompressedDataLength = 0;
    Inflater decompressor = new Inflater();
    decompressor.setInput(input2);
    decompressedDataLength = decompressor.inflate(output2);
    decompressor.end();
    OutputStream outstream2 = ultoutBlob.getBinaryOutputStream();
    outstream2.write(output2);
    outstream2.close();
    return ultoutBlob;
    The only difference I see, is that I do not save the intermediate Zipped content into a BLOB.
    Edited by: user10692128 on 8-dec-2008 6:19
    Edited by: user10692128 on 8-dec-2008 6:20

    Thanks Marcelo, this helped a lot.
    I changed the code as follows:
    public static BLOB Decompress(BLOB inBlob, Connection conn) throws Exception
    BLOB outBlob = BLOB.createTemporary(conn, false, BLOB.DURATION_SESSION);
    OutputStream outstream = outBlob.getBinaryOutputStream();
    InputStream instream = inBlob.getBinaryStream();
    byte[] input = new byte[BLOB.MAX_CHUNK_SIZE];
    byte[] output = new byte[BLOB.MAX_CHUNK_SIZE];
    Inflater decompressor = new Inflater(true);
    while (true) { // read and deflate the data     
    // Fill the input array.
    int numRead = instream.read(input);
    if (numRead == -1) { // end of stream
    // Inflate any data that remains in the input buffer.
    while (!decompressor.finished()) {
    int decompressedDataLength = decompressor.inflate(output, 0, output.length);
    if (decompressedDataLength > 0) {
    outstream.write(output,0, decompressedDataLength);
    } // end if
    } // end while
    break; // Exit while loop.
    } // end if
    else {  // Inflate the input.
    decompressor.setInput(input, 0, numRead);
    while (!decompressor.needsInput()) {
    int decompressedDataLength = decompressor.inflate(output, 0, output.length);
    if (decompressedDataLength > 0) {
    outstream.write(output, 0, decompressedDataLength);
    } // end if
    } // end while
    } // end else
    } // end while
    instream.close();
    outstream.flush();
    outstream.close();
    return outBlob;     
    public static BLOB Compress(BLOB inBlob, Connection conn) throws Exception
    BLOB outBlob = BLOB.createTemporary(conn, false, BLOB.DURATION_SESSION);
    OutputStream outstream = outBlob.getBinaryOutputStream();
    InputStream instream = inBlob.getBinaryStream();
    byte[] input = new byte[BLOB.MAX_CHUNK_SIZE];
    byte[] output = new byte[BLOB.MAX_CHUNK_SIZE];
    Deflater compressor = new Deflater();
    while (true) { // read and deflate the data     
    // Fill the input array.
    int numRead = instream.read(input);
    if (numRead == -1) { // end of stream
    // Deflate any data that remains in the input buffer.
    compressor.finish();
    while (!compressor.finished()) {
    int compressedDataLength = compressor.deflate(output, 0, output.length);
    if (compressedDataLength > 0) {
    outstream.write(output,0, compressedDataLength);
    } // end if
    } // end while
    break; // Exit while loop.
    } // end if
    else {  // Deflate the input.
    compressor.setInput(input, 0, numRead);
    while (!compressor.needsInput()) {
    int compressedDataLength = compressor.deflate(output, 0, output.length);
    if (compressedDataLength > 0) {
    outstream.write(output, 0, compressedDataLength);
    } // end if
    } // end while
    } // end else
    } // end while
    instream.close();
    outstream.flush();
    outstream.close();
    compressor.reset();
    return outBlob;
    It still does not work (I seem to lose some bytes somewhere in the zipping process), but I'm getting closer. ;-)

  • WAS Java Administrator password ok but logon to Visual Admin not working

    Hi,
    I've got a situation with one of our NW 7 Portal systems where logon to both the Portal and Netweaver Administrator application using the Administrator password is ok but the filesystem based visual administrator tool logon does not work with the same password. The correct passwordhas been set in configtool so the secure storage encrypted file is in sync.
    From the Java security trace files I can see that there may be a problem with the "Security Provider" logon ticket configuration as the message issues when the logon to the visual administrator occurs the following trace info is written :-
    nfo#1#com.sap.engine.services.security.authentication.logincontext#Plain###LOGIN.OK
    User: Administrator
    Authentication Stack: SAP-J2EE-Engine
    Login Module                                                               Flag        Initialize  Login      Commit     Abort      Details
    1. com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule   SUFFICIENT  ok          true       true
    2. com.sap.security.core.server.jaas.EvaluateTicketLoginModule             SUFFICIENT  ok                     false
    Central Checks                                                                                true                  #
    I've looked at the following SDN links on a similar issue but I'm not 100% sure the offline configtool process will resolve :-
    /people/shantanu.garg/blog/2009/03/17/offline-configuration-of-login-module-stack-with-configtool
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0bebd22-72f3-2b10-7eab-b93963e8edf2
    Can anyone suggest how best I can get access to the "Security Provider" settings to validate the correct settings are in place to enable the visual administrator to authenticate properly and connect.
    Regards,
    Brian.

    Another development !!!!!
    This is weird......
    I start the Visual Administrator and enter the correct password for the administrator user but get the "error while connecting" after a short while.
    I then enter a wrong password for the administrator user in my next attempt to start the visual administrator and get the "User authentication failed" pop-up straight away.
    I then try another connect using the correct password for the administrator user and..... it connects properly !!!!
    User: Administrator
    Authentication Stack: SAP-J2EE-Engine
    Login Module                                                               Flag        Initialize  Logout     Details
    1. com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule   SUFFICIENT  ok          true       true
    2. com.sap.security.core.server.jaas.EvaluateTicketLoginModule             SUFFICIENT  ok                     false                 #
    #1.#00144FEBC438005E00000003000012FF00049DA77E66D57A#1299242612610#/System/Security/Authentication##com.sap.engine.services.security.authentication.logincontext#Administrator#1050##n/a##0385a932465d11e0a533000000d1065b#SAPEngine_Application_Thread[impl:3]_28##0#0#Info#1#com.sap.engine.services.security.authentication.logincontext#Plain###LOGIN.OK
    User: Administrator
    Authentication Stack: SAP-J2EE-Engine
    Login Module                                                               Flag        Initialize  Login      Commit     Abort      Details
    1. com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule   SUFFICIENT  ok          true       true
    2. com.sap.security.core.server.jaas.EvaluateTicketLoginModule             SUFFICIENT  ok                     false
    Central Checks                                                                                true                  #
    #1.#00144FEBC438007500000000000012FF00049DA77F5BE8EC#1299242628671#/System/Security/Authentication##com.sap.engine.services.security.authentication.logincontext#Guest#0##n/a##0d184332465d11e084b9000000d1065b#SAPEngine_Application_Thread[impl:3]_17##0#0#Info#1#com.sap.engine.services.security.authentication.logincontext#Plain###LOGIN.FAILED
    User: N/A
    Authentication Stack: SAP-J2EE-Engine
    Login Module                                                               Flag        Initialize  Login      Commit     Abort      Details
    1. com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule   SUFFICIENT  ok          exception             true       Authentication did not succeed.
    2. com.sap.security.core.server.jaas.EvaluateTicketLoginModule             SUFFICIENT  ok          exception             true
    Thius means I can at least get access to the Visual Administrator but I can't explain at the moment why this strange behaviour is happening.
    Brian.

  • Enter Ms Acess from java with password

    I've written a program that can save the user's detail into a database, which was build with MS Access. This database has been set a password which i need to enter password to access the table to view the data.
    What the java code need to enter the ID and password to connect to the database, but my database onli need the password. So how to connect to the database from java source code.
    This is the part of the code:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // set this to a MS Access DB you have on your machine
    String filename = "./database/dbImportant.mdb";
    String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
    database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
    // now we can get the connection from the DriverManager
    Connection con = DriverManager.getConnection( database ,"","");

    Connection con = DriverManager.getConnection( database ,"","");
    What should i put into the 2 parameter? One is ID and password, but my database onli need password. If i enter the password parameter only, it will fail to access the database.

  • Can I password protect a zip file?

    Is it possible to encrypt or place a password on a zip file created in the Finder?

    not from finder. you can do it from terminal if you wish or use some 3rd part archiving tool like Stuffit . I think it can make password protected zip files. but zip passwords can be cracked. a better option is to use an encrypted disk image instead of a zip file. you can make one with disk utility.

  • Free java library to zip/unzip files

    Hi all,
    I would like to know if there is any java library to zip and unzip files that can be used freely.
    Thanks in advance,
    Miguel

    Miguel06 wrote:
    Thanks for your answer but what I am looking for is a java class library (and not a java zip utility) similar to the one developed by Chilkat (http://www.chilkatsoft.com/refdoc/javaCkZipRef.html) but I need it to be freely distributable. Obviously, I tried to find it with google before posting in this forum, but I didn't find anything.
    Does [this |http://java.sun.com/developer/technicalArticles/Programming/compression/] help?

  • Getting the zip details

    Hi all
    Am having and important zip file. which is saved with a password, but now i forgot it. But am in a need to open it.
    I tried to open it using the java.utils.zip classes. But whenever am trying to opwn the file its giving an exception that. Header is encripted. So I want to decript it and use any other way. Can any one sujjest how to do it
    With Regards
    Hasanul banna

    As you mentioned, password protected zip files are indeed encrypted by a secret key which is derived from the password you provided.
    You have to retrieve the contents or headers by decrypting the zip file, where java.util.zip package cannot help you more than any other zip utility. If you forgot the password, the only way is to crack it, which is not related to Java anymore.
    ZIP password protection is weaker than RAR one, and it's not much hard to break it. Try using some zip cracking utilities.

  • How to create a zip file whith passwprd ?

    Hi Im trying to create a zip file using the java zip support, the zip file is being created correctly now I have one doubt I would like to know if the zip file can be protected with a password as Winzip does, if so could you tell me please how to do it.
    Regards,
    Antonio
    [email protected]

    With Core Java, for all I know you still can't.

Maybe you are looking for

  • AssertionError while trying to deploy a CMP Entity bean

    Following are my deployment-descriptors - =========================================================================== ejb-jar.xml :- =========== <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.c

  • Rebate Settlements

    Hi all I am a rebate analyst in a retail organisation and use SAP R3 Production to control all rebate agreements. We would have a large volume of individual rebate agreements for vendors and need to regularly set up [<i>USING CODE MEB1]</i> maintain

  • HTML in body of mail

    Hi All, I have to schedule  DB reports in HTML format through mailx . How Report are send as body in HTML format . Thanks, Manish

  • In the past iTunes used to sync any song i download from the web to playlists!

    The last months my iTunes stopped syncing every song i download. I did the update to 12.1 but it stills remain. Is there any option in settings that i can change to?

  • Auto disappearing content using Refresh header?

    Hi, We're pushing a CiscoIPPhoneExecute to a phone. The phone requests the page (CiscoIPPhoneText) in the execute request. The requested page needs to allow the user to respond to a question. If the user doesn't answer to the question, the question s