Is this a java weakness ?!!

Hello, I'm a french student and i'm a java developer;
I have not a good english i hope that you will understand me !
A friend tell me that in java when the secret keys are being used they are in memory and could, in theory, be accessed by another application running at the same time.
In C it's possible to take steps against such theft, but in Java the programmer has almost no control of the memory, and keys held in RAM could conceivably be read by another application. Even worse, if the encryption program is relying on Java garbage collection, there's no telling how long those keys will actually exist in memory; they could even find themselves paged into virtual memory (on the hard drive) where they might hang about for months before that part of the hard drive is used again!
Is it true ? I'm developing a cryptographic project in java and I am afraid of to commit a huge error (choosing java)!!
please help me !!
you can contact me directly at [email protected]

FYI : This question would've been better directed to the Security -> Cryptography section.
Anything in RAM could potentially be read by another program, this it not restricted to Java.
Good design practises will help minimise exposing private keys to other Java classes though.
Eg.
- make the key private and transient ( not serialised to disc ).
- do not implement serializable
- Make any accessor methods final, so they can't be overridden by another
class which attempts to extend it.
- Define explicit "cleanup" methods, to wipe your data, avoiding your reliance
on the garbage collector.
regards,
Owen

Similar Messages

  • I just updated my latest java but the update is causing problems with some externale devices. So i would like to uninstall this latest java update and get back the previous one. That should solve to problems with my external device

    i just updated my latest java but the update is causing problems with some external devices. So i would like to uninstall this latest java update and get back the previous one. That should solve to problems with my external device.
    Is this possible and how do i do that?
    Anyone who responds thanks for that!
    Juko
    I am running
    Hardware Overview:
      Model Name:          Mac Pro
      Model Identifier:          MacPro1,1
      Processor Name:          Dual-Core Intel Xeon
      Processor Speed:          2,66 GHz
      Number of Processors:          2
      Total Number of Cores:          4
      L2 Cache (per Processor):          4 MB
      Memory:          6 GB
      Bus Speed:          1,33 GHz
      Boot ROM Version:          MP11.005D.B00
      SMC Version (system):          1.7f10
      Serial Number (system):          CK7XXXXXXGP
      Hardware UUID:          00000000-0000-1000-8000-0017F20F82F0
    System Software Overview:
      System Version:          Mac OS X 10.7.5 (11G63)
      Kernel Version:          Darwin 11.4.2
      Boot Volume:          Macintosh HD(2)
      Boot Mode:          Normal
      Computer Name:          Mac Pro van Juko de Vries
      User Name:          Juko de Vries (jukodevries)
      Secure Virtual Memory:          Enabled
      64-bit Kernel and Extensions:          No
      Time since boot:          11 days 20:39
    Message was edited by Host

    Java 6 you can't as Apple maintains it, and Java 7 you could if you uninstall it and Oracle provides the earlier version which they likely won't his last update fixed 37 remote exploits.
    Java broken some software here and there, all you'll have to do is wait for a update from the other parties.

  • Just updated my MacBook Pro to 10.6.8 and now my Filemaker 11 databases (.fp7) do not view properly on my desktop.  Is this a java issue?

    Hi,
    Wondering if anyone knows what's going on with my Filemaker Database that will not view properly on my desktop after upgrading from 10.5 to 10.6.8 on
    my MacBook Pro.   Is this a Java issue?  The data is all there but all I see is blank boxes when I open or click on a specific area in the database.
    My Java version is SE 6 1.6.0.37-bo6-434.

    Let me understand:
    - you have purchased named canon, which is conencted to your PC running windows xp
    - downloaded driver for win xp, and canon works fine
    - canon is connected to that PC via USB
    - that Canon is also activated as network printer, by allowing print sharing in windows; how did you set that option?
    - now, you are in Mac OS x 10.6.8, downloaded Canon driver for Mac OS X, installed it, detected printer on the network, printer was installed; was it detected as attached to that PC running win XP? or not?
    or you set canon by being connected to your mac directly via USB?
    Now, there are some questions you should answer as some details are missing, and your initial text is not clear. Can you print if Canon is connected directly to your mac? did you try that? if not, do it before answering.

  • I have problem in this unzip java codes

    hi all,I have problem in this unzip java codes,I think either the pathway that i put C:.......is wrong or the codes are wrong because when i run it, the zipped folder is not unzipped. So anyone has another set of example or know how to correct it? Thanks!Please post the solution here!
    This is the set of codes that i have:
    import java.io.*;
    import java.util.*;
    import java.util.zip.*;
    public class Unzip {
    public static final void copyInputStream(InputStream in, OutputStream out)
    throws IOException
    byte[] buffer = new byte[1024];
    int len;
    while((len = in.read(buffer)) >= 0)
    out.write(buffer, 0, len);
    in.close();
    out.close();
    public static final void main(String[] args) {
    Enumeration entries;
    ZipFile zipFile;
    if(args.length != 1) {
    System.err.println("Usage: Unzip zipfile");
    return;
    try {
    zipFile = new ZipFile("C:\\Temp\\FolderZiper.zip");
    entries = zipFile.entries();
    while(entries.hasMoreElements()) {
    ZipEntry entry = (ZipEntry)entries.nextElement();
    if(entry.isDirectory()) {
    // Assume directories are stored parents first then children.
    System.err.println("Extracting directory: " + entry.getName());
    // This is not robust, just for demonstration purposes.
    (new File(entry.getName())).mkdir();
    continue;
    System.err.println("Extracting file: " + entry.getName());
    copyInputStream(zipFile.getInputStream(entry),
    new BufferedOutputStream(new FileOutputStream(entry.getName())));
    zipFile.close();
    } catch (IOException ioe) {
    System.err.println("Unhandled exception:");
    ioe.printStackTrace();
    return;
    }

    What does the program output when it's executed? Can you copy the screen and post it here? More info can help solve the problem.
    What exactly is the program supposed to do?
    Add some more println() to show the program flow and what the values of key variables are. For example what is in entries after the entries() method is executed?
    Some prep work on your part would make it easier for us to help.

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Want to know abt the use of "This" in java

    Hii friends,
    As am a newbie am having some basic doubts..
    What is the use of "this" in java..
    how to use it in programs

    This is 15+ months old. Whoever "guest" was, they
    have had their account deleted.Ah Ah. I think it's uj's account ;). Is there any
    person here at SDN who had his/her account deleted
    every 2 days.There have been several.

  • Hello. After this update(Java for OS X 2013-003) stop working Ps3 media server. How to fix it?

    Hello. After this update(Java for OS X 2013-003) stop working Ps3 media server. How to fix it?

    I fix it. I restored the contents of /System/Library/Java/JavaVirtualMachines with the contents found in my latest TimeMachine backup from before the update, PMS works like  again. Something in the latest Java update does break the PS3 mediaserver.

  • How to program this in java? Please help

    How to program this in java?
    please explain steps, it has to come out like this:
    example
    input: 3b1w3b
    output:
    BBBWBBB

    import java.io.*;
    public class Test {
    static java.io.PrintStream o = java.lang.System.out;
    public static void main(String[] args)throws Exception {      
         BufferedReader BR = new BufferedReader(new InputStreamReader(System.in));
         System.out.print("Enter plot for printing: ");
         String s = BR.readLine();
         char[] cs = s.toLowerCase().toCharArray();
         for(int i=0, j=0; i < cs.length-0x1; i+=0x2, j=0)
              while(j++ < (int)(cs[i]-0x30))
                   o.print((char)(cs[i+0x1]-0x20));
    I tried changeing it to this so I can enter my own string, but I want to change it some more so that it can enter multiple input separated by space, so that it can form a sort of picture line by line. I tried using tolkenizer but I get errors. I dont know how to use tolkenizer properly can anyone please TEACH. you dont have to tell how or give me the code if you dont want to. yes I know Im a noob and I dont know java as good as everyone here, If everyone thinks I don't deserve help then DON'T help, I'm just trying to learn programming

  • How can I uninstall this latest java upgrade?

    I just installed a java upgrade called "build 1.6.0_05-b13 and now I cannot get Microsoft Front Page 2003 to work. I have to use MS Front Page to maintain my website. How can I uninstall this latest java upgrade so it will go back to using my previous version of java?

    I believe you may have posted your question to the wrong forum. This forum is for the JavaHelp system, which is used for developing online Help for applications, not for general help on Java.

  • How to solve this error java.util.MissingResourceException

    Hi Friends,
    I had developed one web dynpro application by using  Internationalization - I18N of WebDynPro (Java)  Application (Blog)   but I got one error that is
    <b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b> 
    Actually i created two properties file
    1. lang_en.properties
    2. lang_ta.properties
    I stored this two properties file in this package com.sap.example.language
    and this my code in DOInit()
    sessionLocale =  WDClientUser.getCurrentUser().getLocale();
    resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);
         catch (WDUMException e)
         e.printStackTrace();
         wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));
         wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));
    How to solve this error?
    Guide me.
    Advance Thanks,
    Balaji

    Hi Friends,
    I had developed one web dynpro application by using Internationalization - I18N of WebDynPro -Java Application (Blog) but I got one error that is
    <b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b>
    Actually i created two properties file
    1. lang_en.properties
    2. lang_ta.properties
    I stored this two properties file in this package com.sap.example.language
    and this my code in DOInit()
    sessionLocale = WDClientUser.getCurrentUser().getLocale();
    resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);
    catch (WDUMException e)
    e.printStackTrace();
    wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));
    wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));
    How to solve this error?
    Guide me.
    Advance Thanks,
    Balaji

  • What cause this error: java.util.zip.ZipException: invalid literal/lengths?

    Hi all,
    Our application produces this error in the logs: (our JDEV is 11.1.1.4.0, WLS 10.3)
    org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager _restoreSerializedView
    SEVERE:
    java.util.zip.ZipException: invalid literal/lengths set
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
    at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
    at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2266)
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2279)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
    I have googled this error for hours and search the forum here, but no luck. Can someone please shed some light on this error? Thanks in advance!
    Shawn

    Hi Shawn,
    Please refer the below thing i found. Hope this may help you in moving forward in resolving. I hope this issue has occured when you are deploying your application WAR.
    ======================================================================================
    Method: read()
    Class: at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
    The above class comes in your exception hierarchy above.
    Reads uncompressed data into an array of bytes. This method will block until some input can be decompressed.
    Throws:
    ZipException - if a ZIP format error has occurred
    ====================================
    This also points that your WAR file is corrupt.
    Class: GZIPInputStream
    IOException - if an I/O error has occurred or the compressed input data is corrupt
    Thanks,

  • Problem with JMenus that Persist - Is this a Java bug?

    I am having a problem with JMenus that persist. By this I mean
    that my drop down menus persist on the screen even after they have
    been selected.
    I've checked the Java bug database, and the following seems
    to come closest to my problem:
    Bug ID: 4235188
    JPopupMenus and JMenus persist when their JFrame becomes visible
    State: Closed, not a bug
    http://developer.java.sun.com/developer/bugParade/bugs/4235188.html
    This page says that the matter is closed and is not a bug. The
    resolution of this matter printed at the bottom of the page
    is completely abstruse to me and I would appreciate any
    comments to understand what they are talking about.
    The code at the end of my message illustrates my problem.
    1. Why should paintComponent() make any difference to
    Menu behavior?
    2. Is this a bug?
    3. What's the workaround if I have to paint() or repaint()?
    Thanks
    Tony Lin
    // Example of Menu Persistence Problem
    // Try running this with line 41, paintComponent(), and without line 41
    // Menus behave normally if line 41 is commented out
    // If line 41 exists, menus will persist after they have been selected
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class P2 extends JPanel {
    JMenuItem[] mi;
    public P2() {
    JFrame thisFrame = new JFrame();
    thisFrame.getContentPane().add(this);
    JMenu menu = new JMenu("My Menu");
    JMenuBar mb = new JMenuBar();
    mi = new JMenuItem[4];
    for (int i=0; i<mi.length; i++) {
    mi[i] = new JMenuItem("Menu Item " + String.valueOf(i));
    menu.add(mi);
    mb.add(menu);
    thisFrame.setJMenuBar(mb);
    thisFrame.setSize(400,200);
    thisFrame.setLocation(150,200);
    thisFrame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    System.exit(0);
    thisFrame.setVisible(true);
    public void paintComponent(Graphics g) {} //Affects menu behavior!
    public static void main(String[] args) {
    new P2();

    Well, my understanding of the way painting works is that a component doesn't UNPAINT itself. Instead a message is sent to the component under the coordinates of the menu to REPAINT itself.
    In your demo program the JFrame is the component under the JMenu. The paintComponent() method of JFrame is empty, so nothing gets repainted.
    I added super.paintComponent(g); to the method and everything works fine.

  • Is this a Java bug?

    I am confused. Here is the story. I have the following drive and directory structure:
    c:\MyDir\check
    I have the following two files (mine.java and test.java) in C:\MyDir directory.
    package check;
    public class mine
    public int x = 9;
    import check.*;
    public class test
    public static void main(String[] args)
    mine m = new mine();
    Here are the steps:
    set classpath=.;c:\MyDir;
    javac mine.java
    move mine.class check (placing the .class file in check directory)
    javac test.java
    test.java:6: cannot resolve symbol
    symbol : constructor mine ()
    location: class mine
    mine m = new mine();
    ^
    1 error
    My solution is when I move mine.java out of c:\MyDir then everything works fine.
    Why???

    I think it will also work if you change "import check.*;" to "import check.mine;"
    The javac compiler automatically compiles dependent classes. Normally this is a helpful feature. In the test class, you reference a class named mine. The compiler doesn't know you mean check.mine because you used the wildcard import statement. So the compiler looks thru the Classpath directories for mine.class or mine.java files. It finds mine.java first and tries to compile it. But, as it compiles, it finds the class is check.mine, not plain mine. So you get an error.
    Unfortunately, the error message is somewhat confusing. But, it makes sense to me that you can expect errors if you are going to keep your source code separate from the compiled code, and the source code is in directories where the compiler can find it.

  • What's wrong with this simple java file

    I am learning java input methods. When I tried to compile the below simple java file, there were two errors.
    import java.io.*;
    public class MainClass {
       public static void main(String[] args)  {
        Console console = System.console();
        String user = console.readLine("user: ");
        System.out.println(user);
    }The compiler errors:
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : class Console
    location: class MainClass
    Console console = System.console();
    ^
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : method console ()
    location: class java.lang.System
    Console console = System.console();
    ^
    2 errors
    Could anyone take a look and shed some lights on this?

    I have changed to "import java.io.Console;" but this below errors:
    h:\java\MainClass.java:1: cannot resolve symbol
    symbol : class Console
    location: package io
    import java.io.Console;
    ^
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : class Console
    location: class MainClass
    Console console = System.console();
    ^
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : method console ()
    location: class java.lang.System
    Console console = System.console();
    ^
    3 errors
    -----------

  • Can someone help me understand this? (java generics wildcards)

    Hi all.
    First of all this is my first post on sun forums. Besides that i only used java for few weeks now and i think java is quit a nice language.
    I do have a question regarding java generics and wildcard casting (if you can call it that).
    Assume you have following code.
    public class Test <T extends Number> {
         private T x;
         Test(T x)
              this.x = x;
         T getX()
              return x;
         <U extends Number> void setX(U x)
              this.x = (T)x;
    public class Main {
         public static void main(String[] args) {
              Test<Integer> p = new Test <Integer>(5);
              System.out.println(p.getX());
              p.setX(53.32);
              System.out.println(p.getX());
    }This compiles with following results:
    5
    53.32
    Question:
    First: If I declared p to be of type Test<Integer> then why did x in Test class changed its type from Integer to Double?
    Second: Is this a possible unchecked casting behavior? and if so why does this work but doing something like this :
    Integer x = 5 ;
    Double y = 6.32;
    x=(Integer)y;fails with compile time error?

    Hello and welcome to the Sun Java forums.
    The behavior you describe would not occur if your setX(?) method used T instead of another type constraint.
    However, let's look at why it works!
    At line 1 in main, you create your Test with a type parameter of Integer; this becomes the type variable T for that particular instance of Test. The only constraint is that the type extends/implements Number, which Integer does.
    At line 2 you obtain a reference to a Number, which is what getX() is guaranteed to return. toString() is called on that object, etc.
    At line 3 you set the Number in the Test to a Double, which fits the type constraint U extends Number, as well as the type constraint T extends Number which is unused (!). Note that using a different type constraint for U, such as U extends Object or U super Number, could cause a compile-time error.
    At line 4 you obtain a reference to a Number, which is what getX() is guaranteed to return.
    The quirky behavior of setX is due to the second type constraint, which is obeyed separately; in this case, you probably want to use void setX(T x) {
    this.x = x;
    }edit: For the second part of your question, x = (Integer)y; fails because Integer and Double are distinct types; that is, Integer is not a subclass of Double and Double is not a subclass of Integer. This code would compile and work correctly: Number x = 5 ;
    Double y = 6.32;
    x=y;s
    Edited by: Looce on Nov 15, 2008 7:15 PM

Maybe you are looking for