Closed soatok closed 2 years ago
Okay, so this is a general issue with S-box based AES implementations; notably, the correspondent AES implementation from Bouncy Castle is deprecated with the notice that it should not be used when close observation is possible. The current AES engine in this library is an artifact of the past maintainer's work; I don't know what their reasoning for using the deprecated version was.
This implementation, currently the suggested general-use BouncyCastle implementation, adds operations to compute the other tables from one precomputed table, making a summative cache timing attack infeasible (at least, that's my understanding).
@mwcw do you have thoughts or a plan to resolve this?
Hi,
I'll port AES engine over and get it tested and released ASAP.
MW
The AESEngine from bc-java has been ported in as a replacement and version mentioned here replaced.
A release 3.4.0-rc1 has been created.
MW
Don't forget to fix #140 in the same go. (It's a smaller diff than porting a new engine from Java,, and is also important for the security of AES-GCM.)
Source code:
The core problem here is the use of a table look-up, which leaks your AES keys through cache-timing.
Relevant papers:
Mitigation: Bitsliced S-Boxes.
See also: Bitsliced AES Implementation in C