Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AES GCM with hardware accelerated support before Java 9

My use case involves encrypting large amounts of sensitive data on the order of petabytes using AES with GCM in Java and I will need high throughput to make that task complete in reasonable time.

As was previously asked and answered on here, AES/GCM is still severely crippled in the latest JDK 8 (~17MB/s on my hardware). I'm happy to know that JEP 246 for adding significant hardware acceleration for GCM made it onto the roadmap for Java 9, however General Availability for the next major Java release has been pushed out to over a year away as of me writing this.

So far the fastest implementation I have found is the Bouncy Castle Provider, with no hardware acceleration and throughput on the order of 170MB/s. I know that my hardware supports acceleration by running benchmarks of the native libraries GnuTLS (gnutls-cli --benchmark-ciphers) and OpenSSL (openssl speed -evp aes-128-gcm), both clocking in at over 2GB/s for AES/GCM. Unfortunately I can't find a current Java wrapper around either of these. The closest I've come across is Apache JuiCE, built on OpenSSL, but it was abandoned over 8 years ago.

Has anyone come across a JCE Provider that supports hardware acceleration for AES/GCM that I could use in the near term, either commercial or open source?

like image 212
Wolfgang Avatar asked Feb 03 '16 11:02

Wolfgang


1 Answers

Netty-tcnative provides an alternative SSL engine using JNI to interface with native OpenSSL. You should be able to access the crypto functions directly in a similar way. That said, JEP 246: Leverage CPU Instructions for GHASH and RSA is now part of Java 9, so you should be able to get similar performance without resorting to native code.

like image 138
Pavel Avatar answered Oct 23 '22 14:10

Pavel