Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.java.security > #307

Zeroization and compiler optimization

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED!not-for-mail
From Beloumi <beloumi@riseup.net>
Newsgroups comp.lang.java.security
Subject Zeroization and compiler optimization
Date Sun, 04 Jan 2015 17:52:49 +0100
Organization news.netcologne.de
Lines 19
Distribution world
Message-ID <m8br50$a9j$1@newsreader4.netcologne.de> (permalink)
NNTP-Posting-Host cable-78-34-11-120.netcologne.de
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace newsreader4.netcologne.de 1420390368 10547 78.34.11.120 (4 Jan 2015 16:52:48 GMT)
X-Complaints-To abuse@netcologne.de
NNTP-Posting-Date Sun, 4 Jan 2015 16:52:48 +0000 (UTC)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
Xref csiph.com comp.lang.java.security:307

Show key headers only | View raw


Sensitive data like keys and passwords should be zeroized immediately
which is usually done by Arrays.fill(...).
A compiler may treat this as dead code and it may be eliminated by an
optimization.
Does anybody knows if this is the case for common Java compilers like
javac, ejc... ?
And if so, would the following code prevent such optimizations?

Arrays.fill(input,  (byte) 0);
boolean success = true;
for (byte b : input) {
   if (b != 0) {
      success = false;
      break;
   }
}
if (success == false) {
   System.err.println("zeroization failed");
}

Back to comp.lang.java.security | Previous | NextNext in thread | Find similar


Thread

Zeroization and compiler optimization Beloumi <beloumi@riseup.net> - 2015-01-04 17:52 +0100
  Re: Zeroization and compiler optimization Lothar Kimmeringer <news200709@kimmeringer.de> - 2015-01-05 13:36 +0100
    Re: Zeroization and compiler optimization Beloumi <beloumi@riseup.net> - 2015-01-06 12:55 +0100
      Re: Zeroization and compiler optimization Beloumi <beloumi@riseup.net> - 2015-06-12 09:34 +0200
        Re: Zeroization and compiler optimization Mike Amling <mamling@chaff.us> - 2015-07-06 10:06 -0500
          Re: Zeroization and compiler optimization Beloumi <beloumi@riseup.net> - 2015-07-06 23:24 +0200

csiph-web