mapdb
mapdb copied to clipboard
Encryption API
I'd like to use MapDB for a project, but we need proven encryption methods. Can you add support for encryption plugins? Something that we can just pass an EncryptionStrategy implementation or something similiar in for? This would be a great way to support future encryption based on JCA. I'd even donate an AES implementation based on JCA.
MapDB had support for JCA & AES256 a few years ago (JDBM3). There was complete rewrite and it was not ported yet. I have plan to add into MapDB 2.1 release in a few months.
It will work at two levels:
- Block encryption over entire storage at Volume level. This is slower but does not leak any information.
- serializer wrapper. This encrypts only part of records such as Map values or keys. It leaks some information such as record size, hash order and comparation. It is faster.
If you need it urgently there are two options:
You could pay me and get it in a few days, it is about 4 hours work and I have reasonable prices.
Or you could write it yourself and send me a patch. MapDB source code is not that bad and I would do final polishing.
Relevant code for AES 256 from JDBM 3 is here: https://github.com/jankotek/JDBM3/blob/master/src/main/java/org/apache/jdbm/DBMaker.java#L298
Block layer is here: https://github.com/jankotek/mapdb/blob/master/src/main/java/org/mapdb/Volume.java#L1044
Serializer wrapper which does inflate compression is here. We need similar binary transformation, but for encryption. https://github.com/jankotek/mapdb/blob/master/src/main/java/org/mapdb/Serializer.java#L1912
Moving to 3.0
I can't seem to find any encryption support in v 3.0.3, has it been added? If not when are you planning to support encryption? I'll use v 1.0.6 for now as it seems popular (from maven stats) and supports encryption.
Is encryption not supported in 4.0?
If not then can you please update the Serializer and Block links for reference.