News for hackers. Stuff that matters.
Re:SSH gets protection against side-channel attacks by saurik on Friday June 21, 2019 @11:23AM (#20243300)
In that code, after generateKey, during the sensitive operation, the system might need to do a garbage collection, at which point this array might have been copied to a different location in memory before your call to zero. You have to also "pin" (afaik this is the usual terminology for this) that array to a fixed location (which would then have to be a feature of that runtime and garbage collector) after allocating it but before generating the key.
Re:SSH gets protection against side-channel attacks by rurban on Saturday June 22, 2019 @10:14AM (#20249657)
Java also has no mfence or clflush support, so crypto.zero would never be secure. It might overwrite the key in the store buffer only, but not on the heap immediately, so prone to sidechannel attacks.
Re:SSH gets protection against side-channel attacks by java-man on Tuesday June 25, 2019 @11:26AM (#20275165)
This is interesting. Could you explain this please?
Re:SSH gets protection against side-channel attacks by java-man on Friday June 21, 2019 @11:33AM (#20243390)
So what you are saying is that JVM copying surviving object between generational pools might expose secrets in memory?

A very good point, thank you.

What could be done to mitigate this? Direct ByteBuffer per

https://stackoverflow.com/questions/5670862/bytebuffer-alloc...

?

Re:SSH gets protection against side-channel attacks by MarkSweep on Friday June 21, 2019 @06:17PM (#20246728)
In .NET you can pin memory in the GC heap, either using something like the fixed expression in C# or GCHandle. A quick Googleing did not turn up something usable directly by Java, except ByteBuffer.