<div dir="ltr"><div class="markdown-here-wrapper" id="markdown-here-wrapper-33477" style><a href="#" name="datamanager-crypto"></a><h1 id="datamanager-crypto" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.6em">
DataManager Crypto</h1>
<a href="#" name="idea"></a><h2 id="idea" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.4em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204)">Idea</h2>
<p style="margin:1.2em 0px!important">My idea is to read all fields, encrypt the field values and save it in store (Memory and SQLite)</p>
<a href="#" name="problems"></a><h2 id="problems" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.4em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204)">Problems</h2>
<p style="margin:1.2em 0px!important">1) CryptoBox needs byte[] data to encrypt[1]. We need to get byte[] of all types<br>2) CryptoBox#decrypt returns a byte[] and we need to convert it by field type<br>3) How does it work with nested objects?</p>
<p style="margin:1.2em 0px!important">Ugly code to set decrypted data by field type[2]</p>
<a href="#" name="solution-proposal"></a><h2 id="solution-proposal" style="margin:1.3em 0px 1em;padding:0px;font-weight:bold;font-size:1.4em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204)">
Solution/Proposal</h2>
<p style="margin:1.2em 0px!important">What about serializing entity/model to json, encrypt it and save in Store?</p>
<p style="margin:1.2em 0px!important">If we decide on this, we will not be able to make queries / ReadWithFilter (I think).[3]</p>
<p style="margin:1.2em 0px!important">Any questions, thoughts or tomatoes before I move forward?</p>
<p style="margin:1.2em 0px!important">[1] <a href="https://github.com/aerogear/aerogear-crypto-java/blob/master/src/main/java/org/jboss/aerogear/crypto/CryptoBox.java#L86">https://github.com/aerogear/aerogear-crypto-java/blob/master/src/main/java/org/jboss/aerogear/crypto/CryptoBox.java#L86</a><br>
[2] <a href="https://gist.github.com/danielpassos/31e024a8cfd6c64e151c">https://gist.github.com/danielpassos/31e024a8cfd6c64e151c</a><br>[3] <a href="http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-Querying-encrypted-data-td5068.html">http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-Querying-encrypted-data-td5068.html</a></p>
</div></div>