Jarsigner: invalid END header (bad central directory offset)

I signed a jar (which is a standalone application) with:
C:\>jarsigner -keystore myKeystore myJar.jar
I verified it with
C:\>jarsigner -verbose -verify myJar.jar
It was OK.
I updloaded it to my web site via ftp.
When I try to to downlod it via Java Web Start, I get a java.util.zip.ZipException.
If I try to verify it again with jarsigner, I get:
jarsigner: java.util.zip.ZipException: invalid END header (bad central directory offset).
Can anyone tell me where the jar file may have been corrupted ?
Thanks a lot
Norberto

You were right, John.
Thanks a lot.
I hope to help you one day.
Norberto:
Did you remember to ftp myJar.jar in binary mode? As
I recall, ftp assumes things are ASCII files and does
funny things to the file if it is actually a binary.
A good way to check this, I would think would
calculate the MD5 hash of your signed Jar file just
after you have signed it and then again on the other
end after you've FTPed it with "md5sum myJar.jar" (or
whatever the windows equivalent is, if applicable).
At least that would be where I'd start to look for
something that "messed up" your jar file.
Good luck,
John

Similar Messages

  • Java.util.zip.ZipException: invalid END header

    I get this error when I run the code:
    try {
    jFile = new JarFile(jarBuildFile.getAbsolutePath());
    } catch (IOException ex) {
    System.out.println("Got exception: "+ex);
    but only on very large jar files - about 2.5GB in size.
    With JDK 1.4, I get the error, jar file too large.
    With JDK 1.5, I get the above error (invalid END header).
    With JDK 1.6, it reads the file for about 5 seconds, then reports that the file cannot be opened.
    Smaller jar files work fine. This jar file has two files in it, a small XML file and a large video file.
    I'm running under windows XP.
    Doing a jar -tvf (jdk 1.5) on the large jar file works fine.
    The file was built with the jar command (jdk 1.5).
    Is this a bug in the JDK?
    Thank you!
    -Joe
    http://www.lovehorsepower.com

    Sp0ttedD0g wrote:
    I ran into this problem today too and found out it was due to the fact that I had a jar in my war that I was trying to deploy that had a file format of unicode instead of binary (it had been checked into source control system incorrectly). After updating the jar with the proper format (binary), the problem went away.The other reported problems are due to file size, not content.

  • INVALID END HEADER FORMAT error

    I have just installed the Oracle 9i database on windows NT server, but the
    Oracle Database Configuration Assistant returns INVALID END HEADER FORMAT error, eachtime i attempt to create a new database.
    Oracle 9i software is installed, but no database was created. How can i solve this problem?
    or how can i create the database manaully?
    kayode,
    [email protected]

    Hi,
    If you don't have a database error (ORA-), then you're probably hitting some sort of DBCA bug. I'd use the DBCA to generate scripts and then run the scripts manually to see if you can create a database that way.
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci1054696,00.html
    Are you able to create scripts through DBCA if yes then you can create your database with help of scripts.
    go through below link for manually database creation ( it is also some working in Oracle 9i. After scripts creation. Script creation is different then oracle 10g.)
    http://dbataj.blogspot.com/search/label/Database%20Creation
    if not then you hit bug ( according to above mention link) raise a iTAR.
    regards
    Taj

  • Invalid END header format/no output available for this tool

    help me.
    I install oracle 9i into windows 2k server with pack3. when configuring the ODCA, when OUI prompt:
    invalid END header format&
    no output available for this tool.
    who can tell me that what is happen?
    before this, i had installed this version on windows 2003.

    Dear All
    I have the same problem when installing Oracle9iasR2 on a windows 2000 IBM server
    At the database configuration Assistant of the infrastructutre installation I am always getting this strange message Not a ZIP file (End Header Not found).
    We have tried a lot off scenarios to install Oracle9iasr2 but the installation always fails at the database creation with the followning message
    Not a ZIP file (End Header Not found).
    We had also tried to do the installation using a different copy of CD's with no success.
    Also the same installation on the same server was succesfull with O/S Win2003.
    Then the whole installation fails .
    If anyone has ever faced the same problem and had solved it please advice.
    Thank you in advance.
    Bill

  • Invalid CEN header ( bad signature )

    I get this reeor when I try to import .par file in NWS.
    invalid CEN header ( bad signature )
    also say that The Plugin "com.sap.portal.plugins.config-archiver" caused an exception during the unpack opreation

    Hello! experts,
    I got the same error but i manage to solve it.
    While trying to import the par file, please ensure the 'Project root folder' is giving correctly.
    In my case, when i got the error, the folder i initially selected was not there.
    Check if the Project folder you are selecting is there or folder is read / write.
    This will solve your problem.
    Thanks!
    Regards,
    Kishore
    *Please reward points if this solution works for you*

  • Invalid end header format

    Hi experts,
    I installed oracle 9i on windows Xp. At the end of insatllation, i got error called "Invalid end Header format".
    How can i overcome this?
    Advance thanks,
    With best regards
    sundaravel.R

    Insufficient information.
    What is 9i? Are you referring to 9.0 or 9.2 and then that could be anything from 9.2.0.1 through 9.2.0.8.
    And what is XP? Is this the HOME edition which is unsupported or something else? And which service pack?
    It is impossible to advise you beyond suggesting you provide a lot more information and suggest you consider installing currently supported, not Neolithic, software.

  • Getting error : End-of-central-directory signature not found.

    HI,
    while unzipping the patch we are getting the following error.
    check the below error
    bash-2.05$ unzip p4505133_10105_SOLARIS64.zip
    Archive: p4505133_10105_SOLARIS64.zip
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    ***unzip: cannot find zipfile directory in one of p4505133_10105_SOLARIS64.zip or***
    ***p4505133_10105_SOLARIS64.zip.zip, and cannot find p4505133_10105_SOLARIS64.zip.ZIP, period.***

    Kindly check if the zip file size both at the source and the destination are the same ...

  • End-of-central-directory signature not found

    I am in the process of configuring Grid on a Linux server (OEL 5)
    i have the software onn the server as a zip file and i downloaded it through ftp in binary mode.
    I am not able to extract it,below si the error..
    [root@oemgridsvr Grid]#
    [root@oemgridsvr Grid]# unzip GridControl_10.2.0.4_LINUX.zip
    Archive: GridControl_10.2.0.4_LINUX.zip
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    note: GridControl_10.2.0.4_LINUX.zip may be a plain executable, not an archive
    unzip: cannot find zipfile directory in one of GridControl_10.2.0.4_LINUX.zip or
    GridControl_10.2.0.4_LINUX.zip.zip, and cannot find GridControl_10.2.0.4_LINUX.zip.ZIP, period.
    [root@oemgridsvr Grid]#
    [root@oemgridsvr Grid]#
    [root@oemgridsvr Grid]#
    [root@oemgridsvr Grid]# file GridControl_10.2.0.4_LINUX.zip
    GridControl_10.2.0.4_LINUX.zip: Zip archive data, at least v1.0 to extract
    [root@oemgridsvr Grid]#
    [root@oemgridsvr Grid]#
    Please help !!
    ~Thanks

    I think this is multi-part archive file. Basically, you have to put these files in one big file and unzip that file..
    E.g you must have at least 2 zip files with ext a and b.. EG. for AIX platform there are 2 zip files in the downld zip files.
    Step 1: cat p4547817_10202_AIX64-5L.zip.a p4547817_10202_AIX64-5L.zip.b > p4547817_10202_AIX64-5L.zip
    Step 2: Make sure the checksum is correct as per the file howto.txt.
    $ > /usr/bin/cksum p4547817_10202_AIX64-5L.zip
    should produce output 3252003388 1319974395 p4547817_10202_AIX64-5L.zip
    Step 3: unzip p4547817_10202_AIX64-5L.zip

  • 'Invalid Volume Header' - Repair - is drive safe?

    Hi there.
    Failure to mount external firewire 1TB Maxtor
    error was 'Invalid Volume Header"
    Data Rescue II recovered files to another drive.
    Diskwarrior COULD create another Directory, but could NOT exchange it for the faulty one ?!
    I ended up using Disk Utility to Reformat the Drive.
    Question is, can I trust this drive or do I need to ditch it?...

    Simple answer: No drive is safe.
    An error like the one you saw doesn't necessarily have to be indicative of a failing drive and could have been the result of some other system error, a power fluctuation, whatever. Still, if your data is that valuable you should have it all backed up on a second drive too. You can never trust any drive 100% as they can fail at any time. This isn't just referring to mechanical failure but a recurrence of the kind of thing you just saw.

  • Getting "java.io.StreamCorruptedException: invalid stream header"

    When creating a self made Stream (MacInputStream) and then using an ObjectInputStream over it to read Objects from a socket, I get this error:
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
         at TServidor.run(TServidor.java:32)
    Is there any special feature that the "self-made" streams have to implement to be possible to use ObjectInput streams over them :P ?
    Here is the MacInputStream.java code:
    import java.io.Closeable;
    import java.io.FilterInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Arrays;
    import javax.crypto.Mac;
    public class MacInputStream extends FilterInputStream implements Closeable{
         private Mac mac; // algorithm
         private byte [] mmac; //message MAC
         private boolean FIRST_TIME;
         public MacInputStream(InputStream is,Mac mac) {
              super(is);
              this.mac=mac;
              FIRST_TIME=true;
    public int read() throws IOException{
              if(FIRST_TIME){
                   mmac = new byte [mac.getMacLength()];
                   super.read(mmac);
              if(super.in.available()==0){
                   FIRST_TIME=true;
                   return -1;
              int rbyte = super.in.read();
              FIRST_TIME=false;
              mac.update((byte)rbyte);
              System.out.println("available: "+super.in.available());          
              if(super.in.available()==0){
                   byte [] macres =mac.doFinal();
                   System.out.println("message MAC: "+new String(mmac));
                   System.out.println("calculated MAC: "+new String(macres));
                   if(!Arrays.equals(macres, mmac)){
                        throw new IOException("violated integrity");
              return rbyte;
    public int read(byte [] b) throws IOException{
         if(FIRST_TIME){
              mmac = new byte [mac.getMacLength()];
              super.in.read(mmac);          
         if(super.available()==0){
              FIRST_TIME=true;
              return -1;
         int rbytes = super.in.read(b);
         FIRST_TIME=false;
         mac.update(b);
         if(super.available()==0){
              byte [] macres =mac.doFinal();
              if(!Arrays.equals(macres, mmac)){
                   throw new IOException("violated integrity");
         return rbytes;
    }And here is the "main" function where the exception gets thrown:
    public void run() {
         try {
              ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
              Mac mac = Mac.getInstance("HmacMD5");
              Key key = KeyGenerator.getInstance("HmacMD5").generateKey();          
              oos.writeObject(key);
              oos.flush();
              mac.init(key);          
              ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));
             String test;
             try {
                   while (true) {
                        test = (String)cis.readObject();
                        System.out.println(ct + " : " + test);
              } catch (EOFException e) {
                   System.out.println("["+ct + "]");
              } finally {
              if (cis!=null) cis.close();
              if (oos!=null) oos.close();
         } catch (Exception e) {
             e.printStackTrace();
        }It's exactly in the line: ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));Any ideas?
    I'm starting to desperate :P

    (a) I still don't see where you are writing the MAC that you're reading. You're reading something, but it's all or part of the Object stream header I described above, which is why ObjectInputStream' constructor is throwing that exception.
    (b) You don't need to override read(byte[] b) when you extend FilterInputStream, but you do need to override read(byte[] b, int offset, int length), and you need to do it like this:
    public int read(byte[] buffer, int offset, int length) throws IOException
      int count = 0;
      do
        int c = read();
        if (c < 0)
            break;
        buffer[offset+count++] = (byte)c;
      } while (count < length && available() > 0);
      return count > 0 ? count : -1;
    }This way the read() method gets to see every byte that's read and to do its MAC thing or whatever it does. The above is one of only two correct uses of available() in existence: it ensures that you only block once while reading, which is the correct behaviour e.g. on a network.

  • Problem with StreamCorruptedException: invalid stream header: 3C68746D

    Hi
    I am attempting to code a project in Java which involves the user of object serialization to send a String via serialization from an applet embedded in a JSP tp a servlet all files are running on the same machine for testing purposes.
    However I seem to be getting StreamCorruptedException: invalid stream header: 3C68746D whenever I attempt to read the inputstream once I have written to it.
    My code is as follows below (I apologise for the lack of details I have attempted to comment and simplify my code as much as possible for improved readability)
    ////////////////////////APPLET CODE////////////////
    import java.io.*;
    import java.io.Serializable;
    import javax.servlet.http.*;
    import java.applet.*;
    import javax.swing.*;
    import java.net.*;
    *Compiled using netbeans 5.1
    *Uses Apache server embedded with netbeans
    *JSP address http://localhost:8084/TestServ
    *Applet is embedded within this page
    *Servlet address http://localhost:8084/TestServ/TServ
    public class Main extends javax.swing.JApplet {
    JFrame jf;//frame for the test applet
    JTextArea jt;//result text box
    public Main() {
    jt=new JTextArea();//set up applet
    this.add(jt);
    URL servletURL;
    HttpURLConnection servletConnection;
    InputStream iStream=null;
    try
    {   //this address as far as is known is correct
    servletURL = new URL( "http://localhost:8084/TestServ/TServ" );
    //open connection to servlet
    servletConnection = (HttpURLConnection)servletURL.openConnection();
    //set up connection
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    servletConnection.setUseCaches(false);
    servletConnection.setDefaultUseCaches(false);
    //have tried "GET" and "POST" and "PUT"(PUT not directly compatible with apache servers)
    servletConnection.setRequestMethod("POST");
    servletConnection.setRequestProperty("Content-type","application/octet-stream");
    /*Have also tried application/x-java-serialized-object*/
    //set object output stream
    ObjectOutputStream outStream =
    new ObjectOutputStream(servletConnection.getOutputStream());
    //write a string for test purposes (As far as I am aware String implements Serializable)
    outStream.writeObject("h");
    //flush and close connection
    //have tried a combination of flush and/or close
    outStream.flush();
    outStream.close();
    //get input stream rdy for objectinput stream
    iStream = servletConnection.getInputStream();
    catch(IOException e)
    jt.setText("Error in output "+e);
    ObjectInputStream oInStream=null;
    String str = iStream.toString();
    //iStream at this point equals ""sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@6754d6
    try
    //this is where the error occurs
    //upon even trying to create a objectinputstream using iStream IOException occurs
    oInStream = new ObjectInputStream(iStream);
    //program does not get any further
    oInStream.close();
    catch(IOException e)
    //this error has been driving me crazy :(
    jt.setText("Error in input "+e);
    Servlet code is below however it does not even reach this point
    (If reading input stream is removed from the applet the servlet provides the same error message)
    /////////////////////Servlet code (however does not reach this point)///////////////
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class TServ extends HttpServlet {
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    ObjectInputStream inputFromApplet = null;
    InputStream in = request.getInputStream();
    BufferedReader inTest = null;
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet TServ</title>");
    out.println("</head>");
    out.println("<body>");
    try
    inputFromApplet = new ObjectInputStream(in);
    out.println("<h2>Sucess </h1>");
    catch(EOFException e)
    out.println("<h3>ERROR: " e " Error</h3>");
    out.println("<h3>End Servlet</h3>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    public String getServletInfo() {
    return "Short description";
    Thank you for your time I have searched for an answer for some time now and how found people in similar situations however no solution has been found
    Any help is appreciated
    Az

    The servlet isn't writing any objects back in reply. It is writing text. Not the same thing. If you want to read using an ObjectInputStream you have to write using an ObjectOutputStream.

  • [SOLVED] Massive upgrade broke my system (invalid ELF header)

    Hi,
    Today I decided to upgrade my system (last time i upgraded was 1 or 2 months ago), but now I can't login.
    I use gdm and I tried to login in both KDE and Gnome, with the same error:
    /usr/bin/ssh-agent: error while loading shared libraries: /usr/lib/libkafs.so.0: invalid ELF header
    When I was upgrading my system I noticed the following error for the packages 'pango', 'gconf', 'zsh', 'ktorrent':
    /sbin/ldconfig: /usr/lib/libotp.so is not an ELF file - it has the wrong magic bytes at the start
    /sbin/ldconfig: /usr/lib/libkasf.so is not an ELF file - it has the wrong magic bytes at the start
    /sbin/ldconfig: /usr/lib/libmp3lame.so is not an ELF file - it has the wrong magic bytes at the start
    /sbin/ldconfig: /usr/lib/libMrm.so is not an ELF file - it has the wrong magic bytes at the start
    /sbin/ldconfig: /usr/lib/libUil.so is not an ELF file - it has the wrong magic bytes at the start
    /sbin/ldconfig: /usr/lib/libUil.so is not an ELF file - it has the wrong magic bytes at the start
    /sbin/ldconfig: /usr/lib/libQtDesignerComponents.so is not an ELF file - it has the wrong magic bytes at the start
    This error message is also coming when i use pacman.
    Note that I have an another bug (maybe related to this one), I installed 'xsane' and 'libjpeg' (required by xsane), then I ran into lot of troubles: lot of applications didn't start (amarok, pgadmin, xsane...) so I had to ""fix"" this by symlinking libjpeg,62.
    I hope we can solve this mess.
    Tell me if you need more information
    Vincent
    Last edited by zakora (2009-07-20 19:24:41)

    Well, there still a problem, with readline.
    When I'm unable to use pacman nor to start postgres, i've got this error:
    /bin/bash: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
    I alreadey tried to re-install readline, but it did solve the problem.
    Any suggestion?
    Edit:
    ls -l /usr/lib | grep readline
    -rw-r--r--  1 root root   9,1K juil. 19 20:27 libguilereadline-v-17.a
    lrwxrwxrwx  1 root root     31 juil. 19 01:09 libguilereadline-v-17.so -> libguilereadline-v-17.so.17.0.3
    lrwxrwxrwx  1 root root     31 juil. 19 01:09 libguilereadline-v-17.so.17 -> libguilereadline-v-17.so.17.0.3
    -rwxr-xr-x  1 root root    16K juil. 19 20:27 libguilereadline-v-17.so.17.0.3
    -rw-r--r--  1 root root   291K juil. 19 20:27 libreadline.a
    Edit 2:
    In fact readline is not installed, how can i install it without pacman??
    Last edited by zakora (2009-07-19 19:30:02)

  • Invalid stream header exception

    hi all
    I have a program to encrypt/decrypt a file using existing secret key
    which is generated by my java code and it works fine. I got a key from a friend and an encrypted file to decrypt it but the program throws this exception:
    java.io.StreamCorruptedException: invalid stream header: 87449FAA
    Exception in thread "main" java.security.InvalidKeyException: No
    installed provider supports this key: (null) this is my code:
    try
        //throws exception here
        ObjectInputStream in = new ObjectInputStream(new
    FileInputStream("key.dat"));
        key = (SecretKey)in.readObject();
        byte[] raw = key.getEncoded();
        skeySpec = new SecretKeySpec(raw, "AES");
        in.close();
    catch (Exception e)
        System.out.println(e);
    Cipher cipher = Cipher.getInstance("AES");
    cipher.init(Cipher.DECRYPT_MODE, skeySpec); Honestly i don't know how my friend creates the secret key but i think he uses some key generation tools. I suppose the key file is not corrupted because he used it to encrypt/decrypt other files.

    Looks like your friend did not use Java serialization to save the key in the file.
    Edited by: sabre150 on Apr 13, 2008 5:27 PM

  • Invalid stream header Exception - AES PBE with SealedObject

    I am trying to do an PBE encryption with AES algorithm and SunJCE provider, using the SealedObject class to encrypt/decrypt the data...
    And Im still getting the "invalid stream header" exception. Ive searched this forum, readed lots of posts, examples etc...
    Here is my code for encryption (i collected it from more classes, so hopefully I didnt forget anything...):
        //assume that INPUT_STREAM is the source of plaintext
        //and OUTPUT_STREAM is the stream to save the ciphertext data to
        char[] pass; //assume initialized password
        SecureRandom r = new SecureRandom();
        byte[] salt = new byte[20];
        r.nextBytes(salt);
        SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
        KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);
        SecretKey pbKey = factory.generateSecret(keySpec);
        SecretKeySpec key = new SecretKeySpec(pbKey.getEncoded(), "AES");
        Cipher ciph = Cipher.getInstance("AES/CTR/NoPadding");
        ciph.init(Cipher.ENCRYPT_MODE, key);
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        int ch;
        while ((ch = INPUT_STREAM.read()) >= 0) {
          byteOut.write(ch);
        SealedObject sealed = new SealedObject(byteOut.toByteArray(), ciph);
        BufferedOutputStream bufOut = new BufferedOutputStream(OUTPUTSTREAM);
        ObjectOutputStream objOut = new ObjectOutputStream(bufOut);   
        objOut.writeObject(sealed);
        objOut.close();
      }And here is my code for decrypting:
        //assume that INPUT_STREAM is the source of ciphertext
        //and OUTPUT_STREAM is the stream to save the plaintext data to
        char[] pass; //assume initialized password
        SecureRandom r = new SecureRandom();
        byte[] salt = new byte[20];
        r.nextBytes(salt);
        SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
        KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);
        SecretKey pbKey = factory.generateSecret(keySpec);
        SecretKeySpec key = new SecretKeySpec(pbKey.getEncoded(), "AES");
        BufferedInputStream bufIn = new BufferedInputStream(INPUT_STREAM);    //MARK #1
        ObjectInputStream objIn = new ObjectInputStream(bufIn);   
        SealedObject sealed = (SealedObject) objIn.readObject();   
        byte[] unsealed = (byte[]) sealed.getObject(key);          //MARK #2
        ByteArrayInputStream byteIn = new ByteArrayInputStream(unsealed);
        int ch;
        while ((ch = byteIn.read()) >= 0) {
          OUTPUT_STREAM.write(ch);
        OUTPUT_STREAM.close();Everytime I run it, it gives me this exception:
    Exception in thread "main" java.io.StreamCorruptedException: invalid stream header: B559ADBE
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
         at javax.crypto.SunJCE_i.<init>(DashoA13*..)
         at javax.crypto.SealedObject.unseal(DashoA13*..)
         at javax.crypto.SealedObject.getObject(DashoA13*..)
         at oopsifrovanie.engine.ItemToCrypt.decrypt(ItemToCrypt.java:91)  //MARKED AS #2
         at oopsifrovanie.Main.main(Main.java:37)    //The class with all code below MARK #1I've also found out that the hashCode of the generated "key" object in the decrypting routine is not the same as the hashCode of the "key" object in the ecrypting routine. Can this be a problem? I assume that maybe yes... but don't know what to do...
    When I delete the r.nextBytes(salt); from both routines, the hashCodes are the same, but that's not the thing I want to do...
    I think, that the source of problem can be this part of code (generating the key):
        SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
        KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);
        SecretKey pbKey = factory.generateSecret(keySpec);
        SecretKeySpec key = new SecretKeySpec(pbKey.getEncoded(), "AES");But I derived it from posts like: [http://forums.sun.com/thread.jspa?threadID=5307763] and [http://stackoverflow.com/questions/992019/java-256bit-aes-encryption] and they claimed it's working there...
    Is there anyone that can help me?
    Btw, I don't want to use any other providers like Bouncycastle etc. and I want to use PBE with AES and also SealedObject to store the parameters of encryption...

    Yes, it really uses only one Cipher object, but it does decoding in a little nonstandard (not often used) way, by using the SealedObject class and its getObject(Key key) method. You can check these links for documentation: [http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#SealedObject] and [http://java.sun.com/javase/6/docs/api/javax/crypto/SealedObject.html] So the question is, why it doesn't work also with the AES routines, because it should.
    Btw, according to [http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunJCEProvider] PBEWithSHA1AndDESede/CBC/PKCS5Padding is a valid JCE algorithm for the Cipher class.
    Firstly, I was generating the key for AES enc./decryption this way and it was working:
    char[] pass; //assume initialized password
    byte[] bpass = new byte[pass.length];
        for (int i = 0; i < pass.length; i++) {
          bpass[i] = (byte) pass;
    SecretKeySpec key = new SecretKeySpec(bpass, "AES");
    But I think, that it really wasn't secure, so I wanted to build a key from the password using the PBE.
    Maybe there's also a way how to do this part of my AES PBE algorithm: *KeySpec keySpec = new PBEKeySpec(pass, salt, 1536, 128);* manually (with my own algorithm), but I dont know how to do it and I'd like it to be really secure.
    Btw, thanks for your will to help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • LWAPP"invalid IP header checksum"

    Hello , i hace a problem with a wireless network based on 4 WiSM (two in two 6500) and AP1010. AP's get IP from the DHCP and associate to the controller, but after a while, they start sending a syslog message LWAPP-ERROR: "invalid IP header checksum". I have ping losses and the AP dissasociates, reloads and reassociates to the controller. Does anyone have found the same problem?
    thanks

    What code are you running on the WLC's? I know that with the AP1010, you can't be running the newer code. that is why I ask.
    Is this happening on all 4 WLC's and can you post a snip of the log from the cli.

Maybe you are looking for

  • Visual Voicemail Problems

    Back when we were able to download the visual voicemail on our phones, I followed the steps it said, which including restoring my phone. I did that but I had the problem where people would leave me voicemails and it would not show up. The only way I

  • Motion quits unexpectedly during text edit on 3D text template

    Motion quits unexpectedly during text edit on 3D text template. When I was trying to select 'live font' instead of 'system font'... I recently updated to snow leopard and I'm having trouble using FCP, motion... very simple procedures, it quits... wha

  • How can I use LabVIEW to ground floating SCXI-1520 channels (in order not to lose scanning capabilities from the multiplexer)?

    Currently I am reading quarter bridge strain with several SCXI-1520s. When in MAX I noticed my values were no longer reading after a certain gage and as I attempted to troubleshoot, found out that the multiplexer in this module will not scan past any

  • Video Problems - Pixelization

    Ok here are my system specs: -Hardware- Motherboard: MSI 875P NEO-FISR 2.0 RAM:  Kingston KVR400X64C3AK2/2G 2GB Kit 400MHz DDR PC3200 DIMM 3-3-3 Standard 128M X 64 Non-ECC 400MHz 184-pin Unbuffered DIMM (SDRAM-DDR, 2.6V, CL3, Gold) CPU: Intel Pentium

  • JMS Adapter Frame Work Error  - No Alert

    Hi All,    We  have configured Alert Frame Work in Development and it is working fine . Only issue with Adapter Frame work I am able to catch all the errors in File adapter like   wrong directory, FTP errors and No sender agreement but for JMS Commun