<div dir="ltr">Hello Bruno,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 5, 2014 at 5:05 PM, Bruno Oliveira <span dir="ltr"><<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You shouldn’t store your private key, please make use of the suggested code and let me know.<br>
</blockquote><div><br></div>
<div><br></div><div>OK, not storing the 'private key', but instead I am only storing the IV, salt and ciphertext, right ? </div><div><br></div><div><br></div><div>The following code is basically the (relevant) code behind the web-form when someone creates the logical construct of an iOS variant:</div>
<div><br></div><div><a href="https://github.com/matzew/psswd-salting/blob/master/src/test/java/net/wessendorf/salt/SecretKeyTest.java#L44-L62">https://github.com/matzew/psswd-salting/blob/master/src/test/java/net/wessendorf/salt/SecretKeyTest.java#L44-L62</a><br>
</div><div><br></div><div>In real I get all the information for the variant (e.g. its name, its description, its certificate file and the passphrase for the certificate), but the above has been limited to the passphrase, as everything else is not so important here :-)</div>
<div><br></div><div>So after that I have basically the following pieces in the database:</div><div>* IV</div><div>* salt</div><div>* ciphertex</div><div><br></div><div>instead of the plaintext passphrase for the iOS certs. </div>
<div><br></div><div><br></div><div><br></div><div>But, now, somewhere later in in the program, I need to do the decryption to get the actual passphrase for the stored Apple-certificate.</div><div>However, I don't see how to create the CryptoBox here, as I should not stash the private/secret key, nor do I have access to the previous CryptoBox object</div>
<div><br></div><div><a href="https://github.com/matzew/psswd-salting/blob/master/src/test/java/net/wessendorf/salt/SecretKeyTest.java#L64-L85">https://github.com/matzew/psswd-salting/blob/master/src/test/java/net/wessendorf/salt/SecretKeyTest.java#L64-L85</a><br>
</div><div><br></div><div><br></div><div>Looks like I am missing something here</div><div><br></div><div>-Matthias</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
--<br>
abstractj<br>
<div><div><br>
On February 5, 2014 at 2:00:45 PM, Matthias Wessendorf (<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>) wrote:<br>
> > Ah, thanks for the hints. I have a little isolated test case.<br>
> In there I (potentially) store the privateKey, the IV and the<br>
> ciphertext in the database.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>