Differences in JCE policy files between java 1.4 and 1.5?

I'm using a app that needs JCE unlimited strength policy files to start. Attempting to start with limited strength policy files with Java 1.4 installed will give:
java.security.InvalidKeyException: InitVerify error: java.lang.RuntimeException: engineGetKeySize() is not supported by this cipher!
however, running the same app on java 1.5 with limited strength policy files does not give this problem. I've checked http://java.sun.com/j2se/1.5.0/docs/guide/security/jce/JCERefGuide.html#AppE and http://java.sun.com/j2se/1.4.2/docs/guide/security/jce/JCERefGuide.html#AppE and the maximum allowed keysizes are identical. Has something else changed in the JCE policy files between these java versions? Can anyone tell me what's going on?

Incubus wrote:
say I have a code that does:
public void StringConcat(){
int noOfIter = 10000;
for(int i = 0; i < noOfIter; i++){
String s = "String " + i + " Being " + i + "concatenated " + i + "using " + i + "String" + i + "Builder";
If I compile this in 1.4 ( i.e using javac -source 1.4); the decompiled code looks the same.
But if I do so in 1.5 ( i.e if I decompile the same code compiled using javac -source 1.5), this is how it looks:
public void StringConcat(){
int noOfIter = 10000;
for(int i = 0; i < noOfIter; i++){
String s = (new StringBuilder).append("String ").append( i).append( " Being ").append( i).append( "concatenated ").append( i).append( "using ").append( i).append( "String").append( i).append( "Builder").toString();
The above was the compile time optimization I was talking about.What makes you think that the decompiler is not the problem?
The ONLY difference between 1.5 and 1.4 in that case is that one uses StringBuilder and one uses StringBuffer. And StringBuffer is faster.
Just wanted to know, are there any other differences in compile time optimizations between 1.4 and 1.5.I suggest that you go look at the read me. And I also suggest that you become familar with byte codes and stop assuming that a decompiler is going to tell you anything.

Similar Messages

  • Differences in optimizations during compilation between java 1.4 and 1.5

    Hi
    I have an application which frequently runs into out of memory error. After doing some profiling, I found that it has more to do with the throughput of the application. Because which, messages that have to be polled from a queue are not being dequeued. This application has been compiled in java 1.5. But when I compiled the same in java 1.4, I didn't get into this problem.
    When I de-compiled the class files, I found that in 1.5, for every string concatenation, the compiler replaces it with StringBuilder() and appends the string. To check whether this object instantiation might be causing the trouble, I wrote a small snippet:
    private static void doWithConcatenationOperator() {
    for (int idx = 0; idx < fNumIterations; idx++) {
    String result = "Does" + "StringBuilder()" + "reduce"
    + "ThroughPut" + "of the" + "Application";
    private static void doWithStringBuilder() {
    for (int idx = 0; idx < fNumIterations; idx++) {
    (new StringBuilder()).append("Does").append("StringBuilder()")
    .append("reduce").append("ThroughPut").append("of the")
    .append("Application").toString();
    When I iterate through these loops( 1 million iterations), the concatenation operation takes less than 16 milliseconds whereas the StringBuilder takes upwards of 512 milliseconds.
    My question being; are there any other so called optimizations that can reduce the throughput when compiled in 1.5.
    Thanks
    Edited by: Incubus on Jan 18, 2009 11:00 PM

    Incubus wrote:
    say I have a code that does:
    public void StringConcat(){
    int noOfIter = 10000;
    for(int i = 0; i < noOfIter; i++){
    String s = "String " + i + " Being " + i + "concatenated " + i + "using " + i + "String" + i + "Builder";
    If I compile this in 1.4 ( i.e using javac -source 1.4); the decompiled code looks the same.
    But if I do so in 1.5 ( i.e if I decompile the same code compiled using javac -source 1.5), this is how it looks:
    public void StringConcat(){
    int noOfIter = 10000;
    for(int i = 0; i < noOfIter; i++){
    String s = (new StringBuilder).append("String ").append( i).append( " Being ").append( i).append( "concatenated ").append( i).append( "using ").append( i).append( "String").append( i).append( "Builder").toString();
    The above was the compile time optimization I was talking about.What makes you think that the decompiler is not the problem?
    The ONLY difference between 1.5 and 1.4 in that case is that one uses StringBuilder and one uses StringBuffer. And StringBuffer is faster.
    Just wanted to know, are there any other differences in compile time optimizations between 1.4 and 1.5.I suggest that you go look at the read me. And I also suggest that you become familar with byte codes and stop assuming that a decompiler is going to tell you anything.

  • Java: Where are JCE Unlimited Strength Jurisdiction Policy Files for Java for Mac OS X 10.7?

    I need to install the JCE Unlimited Strength Jurisdiction Policy Files for Java 1.6 under Mac OS X 10.7.  I know where to get then from the Sun/Oracle Java download site, but want to make sure that these will work on the Mac.  Or, are there Mac specific versions somewhere?

    There's a  jce.jar file in /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/, so it appears that they're already in place, but that's just a WAG.

  • Difference between Java 1.2 and 1.4

    Can Anyone tell me the Difference between Java 1.2 and 1.4

    Hi,
    Well to start with, a hell lot of classes have been added, and others have been altered. The only change in the language is that the assert statement was added.
    An application written in 1.2 will most likely run under 1.4.
    /Kaj

  • Differences between Java Virtual Machine and Java HotSpot ??

    I am little bit confused between Java Virtual Machine and Java HotSpot.
    My understanding is:
    Java Virtual Machine is the environment to execute Java programs. I think I could understand this part.
    However, the description says, "The Java HotSpot product line consists of a server-side and a client-side virtual machine that share the Java HotSpot runtime environment, but have different compilers suited to the different performance characteristics of clients and servers."
    I am confused with server-side virtual machine. what is that?? Does it mean the environment to execute Java programs remotely through network?? For example, Java plug-in.?? Please advise.

    Hotspot is a JVM.
    Hotspot has different configuration settings. Some of those settings are better suited for a client application. Some are better suited to server applications.

  • How do I share files between my iPhone 5 and MacBook Pro?

    I need to transfer files between my iPhone 5 and my MacBook Pro. The latter is running Mavericks. I have enabled AirDrop on both devices (I chose "AirDrop for Everyone" on my iPhone), but when I click the AirDrop file in Finder on my Mac, my iPhone doesn't appear. 
    Thoughts?

    Sorry; I've got Yosemite installed on my MacBook Pro, not Mavericks anymore.

  • I want to share files between my MacBook Pro and G5, I am using an AirPort

    I want to share files between my MacBook Pro and G5, I am using an AirPort Extreme Base Station. I can see the MacBook Pro on the G5 and vice versa, I have file sharing turned on both, as well as Screen Sharing. I currently am sharing using Target Disk Mode, I want to know what other wireless options are available to me?
    I want to have the 2 computers able to see each other and be able to share files be drag and dropping, I also have another G4 on using Tiger I want to be a part of this happy Apple sharing family. Can someone please tell me how to accomplish my goal?
    Thanks in advance for reading and replying to my post,
    Sebastian

    The mac help is: Finder window/Help/Mac Help. It provides answers to a lot of common questions, including file sharing.
    As for the ethernet cable, you can either buy another one (inexpensive and available in many places including Walmart), or just unplug it from your modem temporarily and plug it back in when you're done.
    As for Target disk mode, take a look at this Apple article:
    http://docs.info.apple.com/article.html?artnum=58583
    Apple online support pages are also a great way to find out how to do things.
    As I mentioned, I prefer using the ethernet/file sharing method if I need to copy a lot of files; however, there is another way around if you have an external drive and just want to copy one or two files. Just plug the external into one computer, copy the file onto it, unplug, plug into the other computer and copy.

  • Leopard / Bootcamp / Vista / Copy Files Between Mac OS X and Windows

    On the apple page it says I can copy files from mac to windows?
    "Copy Files Between Mac OS X and Windows
    Copy, open, modify, or delete files in Mac OS X that you saved to your Windows partition. Leopard understands the Windows FAT32 disk format."
    I tried installing Vista in bootcamp, but it says I cannot install in FAT32? So i format it to NTFS.
    So here's my question, Can i still copy files between mac and pc, if I format into NTFS or am using vista?
    Thanks

    I am quite a simple soul really and very easily pleased.
    All I seek is a partition of some sort that I can save all my created work to - whether in XP Pro or OS X 10.5. But it has to be a large partition - probably a single partition on a large drive.
    It would be sweeter still for Spotlight to do what it does (and it does on a FAT partition) and sweeter still for Time Machine to be very user friendly and do what it presently does not do and include created files into the TM.
    Now that really would be very pleasant. Very pleasant indeed.

  • Sync my files between my pc phone and tablet

    how can i use my 2gb free creativ cloud to sync my files between my pc phone and tablet

    Mylenium,
    It works fine between my iPhone 4s PS touch and my Samsung galaxy note 10.1 with PS touch But not with my computer Windows 8 Adobe Photoshop  elements 11
    I dont see the cloud files on my computer
    Verstuurd vanaf mijn iPhone
    Op 18 aug. 2013 om 08:58 heeft Mylenium <[email protected]> het volgende geschreven:
    Re: sync my files between my pc phone and tablet
    created by Mylenium in Adobe Creative Cloud - View the full discussion
    What phone? What tablet? What files? You will have to explain better.
    Mylenium
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5604082#5604082
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5604082#5604082
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5604082#5604082. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Creative Cloud by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How do I transfer files between my iPad 2 and my iMac?

    How do I transfer files between my iPad 2 and my iMac? I can't seem to make file sharing work following the iPad 2 instructions. Thanks. Bob

    You may want to post your own thread on this. this one is well over a year old.
    This might help you: http://support.apple.com/kb/HT1848

  • Distributing software with unlimited strength JCE policy files

    I'm about to release some software that uses AES 256-bit encryption. I had to download the "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6" to do this level of encryption. I'd like to distribute my software with a bundled version of the JRE that includes these policy files. The software will be available to download from the Internet for those who pay for the service. Placing it on the Internet is technically an export because it's available to anyone in the world.
    I've talked to the Bureau of Industry and Security and they said I need to file for a classification number (ECCN). Is this necessary if I'm using Sun's software? The JCE has already been through the export approval process so it would make sense if just including it in my software required nothing. I haven't been able to find any information about what to do legally if using the unlimited strength policy files. What laws do I need to know about or comply with to do this? Also, are there any legal ramifications of including the JRE with my software? I'm using a custom jre launcher that lets me bundle whatever jre I want with my software, so I assume it's a common practice, but I'm not sure.
    Any help would be appreciated.

    I posted this question on other sites as well, but never heard any good answers.
    I've had to do some research and I've heard a few different things, but this is what I've learned:
    Software being exported (putting on the Internet is an export) that contains symmetric encryption above 64-bit requires filling out a BIS-748P form. I had to first of all request a PIN and CIN (company id number) from the BIS so that I can access their SNAP-R system which is where you fill out and submit all the paper work (including the BIS-748P) online. I haven't filled that out yet, but once you do they will review your software and classify it with an ECCN number and depending on what if falls under they will require you to obtain a license or license exception. For what I'm doing (and what most probably need this for), a license is not needed. It's simply classified as a type of encryption software and they know who you are and what you're doing with it.
    Until this is filed, the software is under a certain statute as to what you can do with it and there's a lot of legalities behind this entire process that I don't fully understand, but I think filling this paperwork out and talking to those who receive it is a good place to start.
    I'm not a lawyer by any means and I could be missing some details, but this is what I understand about the process. If you learn anything else (or find some of this to be untrue), let me know.

  • How import policy file with Java Web Start

    hi everybody,
    I wrote an application launched by Java Web Start.
    This application encrypt data on the client side and POST them to the server.
    To encrypt I use JCE packages including sunjce_provider.jar, jce1_2_1.jar and
    local_policy.jar and US_export_policy.jar.
    local_policy.jar and US_export_policy.jar are not packages, each of them contains
    a policy file.
    When I test encryption on local no problem, but when I test with Java Web Start
    I've got this exception :
    java.lang.ExceptionInInitializerError:
    java.lang.SecurityException: Cannot set up certs for trusted CAs
    It's because the application launched by Java Web Start doesn't find local_policy.jar
    and US_export_policy.jar.
    There's a problem in my JNLP file :
    <jnlp spec="1.0+" href="http://myserver/sources/test.jnlp" codebase="http://myserver/sources">
         <information>
              <title>Java Web Start TEST</title>
              <vendor>NLE Intech</vendor>
              <description>cryptage then upload</description>
         </information>
         <security>
              <all-permissions/>
         </security>
         <resources>
              <j2se version="1.3" />
              <jar href="sunjce_provider.jar" />
              <jar href="jce1_2_1.jar" />
              <jar href="local_policy.jar" />
              <jar href="US_export_policy.jar" />
         </resources>
         <application-desc main-class="HelloWorldSwing" >
              <argument>c:\myfiletoencrypt</argument>
         </application-desc>
    </jnlp>
    thank you for your answer

    Hi Nicolas,
    If you migrate to JDK1.4 and use the signed Bouncy JAR, you could resolve the problem,
    if you don't want to use unlimited cryptography.
    See my posting on your other question.
    Agnes
    PS. There is a mistake in my other reply, the "local_policy.jar" and the other files must have
    to go into JRE/LIB/SECURITY directory

  • How do you use .wsse policy file from Java Client?

    I'd like to call a WSSE enabled web service from my Java client but setup my encryption/signing requirements with a .wsse policy file.
    I know how to call a web service by programmatically setting up the security headers as described in:
    http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html
    But how can I do the same thing by simply using a .wsse file?

    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    import java.net.*;
    public class links extends java.applet.Applet {
       Panel panel = new Panel();
       public links(){
          super();
          add(panel);
          Link link = new Link(this,"Answers for programmers;- ","http://forum.java.sun.com");
          panel.add(link);
       public void init(){
          setVisible(true);
       public class Link extends Label implements MouseListener {
          Applet applet;
          Color fcolor = Color.blue;
          Color lcolor = Color.pink;
          String text;
          String word;
       public Link(Applet ap, String s, String s1){
          super(s);
             this.applet = ap;
             this.text = s;
             this.word = s1;
             addMouseListener(this);
          setForeground(fcolor);
       public void paint(Graphics g){
       super.paint(g);
          if (getForeground() == lcolor){
             Dimension d = getSize();
             g.fillRect(1,d.height-5,d.width,1);
       public void update(Graphics g){paint(g);}
       public void mouseClicked(MouseEvent e){
          try{
             URL url = new URL(word);
             applet.getAppletContext().showDocument(url,"_self");
          catch(MalformedURLException er){ }
       public void mouseEntered(MouseEvent e){
          setForeground(lcolor);
          setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
          repaint();
       public void mouseExited(MouseEvent e){
          setForeground(fcolor);
          setCursor(Cursor.getDefaultCursor());
          repaint();
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
       public static void main (String[] args){
          new links(); 
    }

  • Import a policy file in java 1.5

    Hi:
    The quesiton I am about to ask might not really relate to java programming...but I have no idea where else I can get help. I am an university student and my school use a online java submission system. In order to hand in my java programs, I need to set up a new policy so that I am able to up load the files. However, school hasn't been able to help people who use java 1.5 to fix the problem. Can somebody kindly help me solve the problem. Thank you for your time.
    here is the policy file which I have no idea where to put it
    grant codeBase "https://www.scs.carleton.ca/raven/-" {
    permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete";
    permission java.util.PropertyPermission "*", "read";
    grant codeBase "https://raven.scs.carleton.ca/-" {
    permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete";
    permission java.util.PropertyPermission "*", "read";
    };

    You can put it anywhere you like.
    Then in the command line where you start the application that needs to use it you do this:java -Djava.security.policy='whereveryouputit' ...Unless the application that needs to use it loads its security policies in some other way.

  • Difference in displaying RAW files, between Camera RAW 5.3 and default preview...

    Weird problem: when I import new RAW pics from my Canon (EOS 450D), they are previewed by the catalog viewer in very vivid and live colors. However when I try to edit them using Camera RAW 5.3, the INITIAL image that pops up is very dull... How come there is a difference in the algorithm when doing the "default" preview and the one used by the initial view of Camera RAW ?
    I want to have the same "start" image in Camera RAW as shown by the default preview...
    (I hope this is a clear enough exposition of the problem...)
    Thanks!
    Misha.

    The initial image that pops up is a low resolution .jpg preview that is embedded in the RAW file.
    The duller version is indeed your unprocessed RAW photograph. Processing should make it look just as good, or better, than that .jpg preview.

Maybe you are looking for