<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 24, 2013 at 2:05 PM, Kris Borchers <span dir="ltr">&lt;<a href="mailto:kris@redhat.com" target="_blank">kris@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Sep 23, 2013, at 2:38 PM, Sébastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Do we also plan to use this encrypt/decrypt module when storing data using our datastore facilities ?<br>
<br>
</div>I thought that was kind of obvious that this would be an option.<br></blockquote><div><br></div><div style>:) Ok , that was also pretty obvious for me  but maybe not for the whole community </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

&gt;<br>
&gt; If yes, it could be nice to be able to do as with the pipes and the authenticator : passing a &quot;Encryptor&quot;  instance to a Store …<br>
<br>
I would rather just do something like pass in an encryptionKey or something like that which would tell the store to do encryption/decryption and not have to instantiate a crypto object.<br></blockquote><div style>Yes that makes sense.</div>
<div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt; Envoyé de mon iPhone<br>
&gt;<br>
&gt; Le Sep 23, 2013 à 21:31, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; a écrit :<br>
&gt;<br>
&gt;&gt; Hi gentlemen, I tried to put our ideas together into a gist<br>
&gt;&gt; <a href="https://gist.github.com/abstractj/f1229ae075f8e6688c75" target="_blank">https://gist.github.com/abstractj/f1229ae075f8e6688c75</a>. Feel free to<br>
&gt;&gt; fork and change, here comes the content:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; # AeroGear JS Crypto<br>
&gt;&gt;<br>
&gt;&gt; # Goals<br>
&gt;&gt;<br>
&gt;&gt; - Behind the scenes our developers will make use of sjcl<br>
&gt;&gt; (<a href="http://crypto.stanford.edu/sjcl/" target="_blank">http://crypto.stanford.edu/sjcl/</a>) with wrappers to the basic<br>
&gt;&gt; functionalities like: encrypt, decrypt, password salting and key pair<br>
&gt;&gt; generation.<br>
&gt;&gt;<br>
&gt;&gt; - Advanced developers will be allowed to make use of the pure sjcl<br>
&gt;&gt; implementation.<br>
&gt;&gt;<br>
&gt;&gt; - The pattern of AeroGear.js without the use of new keyword must be<br>
&gt;&gt; followed. Ex:<br>
&gt;&gt; <a href="https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/aerogear.pipeline.js#L67" target="_blank">https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/aerogear.pipeline.js#L67</a><br>

&gt;&gt;<br>
&gt;&gt; - More user friendly interface could be provided like:<br>
&gt;&gt;<br>
&gt;&gt;   AeroGear.encrypt(&quot;blah&quot;);<br>
&gt;&gt;   AeroGear.decrypt( cipherText );<br>
&gt;&gt;<br>
&gt;&gt; - Built as a separated module<br>
&gt;&gt;<br>
&gt;&gt; # API initial definition/decision (draft)<br>
&gt;&gt;<br>
&gt;&gt; ## Encryption<br>
&gt;&gt;<br>
&gt;&gt; - Key generation process for encryption &quot;automatically&quot; or explicity?<br>
&gt;&gt;<br>
&gt;&gt;   - Automagically<br>
&gt;&gt;       AeroGear.encrypt(&quot;blah&quot;); //key is generated behind the scenes<br>
&gt;&gt;       AeroGear.privateKey; // could provide the generated key<br>
&gt;&gt;<br>
&gt;&gt;   - Explicit (+1 from my side)<br>
&gt;&gt;       var myKey = AeroGear.generateKey;<br>
&gt;&gt;       AeroGear.encrypt(mykey, &quot;blah&quot;);<br>
&gt;&gt;<br>
&gt;&gt; ## Decryption<br>
&gt;&gt;<br>
&gt;&gt;   - Option 1<br>
&gt;&gt;       AeroGear.privateKey = myKey<br>
&gt;&gt;       AeroGear.decrypt(nonsenseciphertext);<br>
&gt;&gt;   - Option 2<br>
&gt;&gt;       AeroGear.decrypt(mykey, nonsenseciphertext);<br>
&gt;&gt;<br>
&gt;&gt; ## Open questions<br>
&gt;&gt;<br>
&gt;&gt; - Do we need a separate repository?<br>
&gt;&gt; - Would the keys be automatically generated by default during the<br>
&gt;&gt; encryption process?<br>
&gt;&gt; - What would be the best way to provide the keys for encryption?<br>
&gt;&gt; - Will the AG JS crypto library be tied to AeroGear JS? For example:<br>
&gt;&gt; Users just looking for crypto, could make use of our work?<br>
&gt;&gt;<br>
&gt;&gt;&gt; Kris Borchers &lt;mailto:<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt;<br>
&gt;&gt;&gt; September 23, 2013 3:07 PM<br>
&gt;&gt;&gt; On Sep 23, 2013, at 1:04 PM, Lucas Holmquist &lt;<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Sep 23, 2013, at 2:01 PM, Kris Borchers &lt;<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Sep 23, 2013, at 12:40 PM, Kris Borchers &lt;<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; On Sep 20, 2013, at 10:05 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Good morning slackland, following with the plan I started a simple draft<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; for JavaScript (<a href="https://github.com/abstractj/cryptoparty-js" target="_blank">https://github.com/abstractj/cryptoparty-js</a>) we have<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; several alternatives outside there the most popular are Crypto-js<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; (<a href="https://code.google.com/p/crypto-js/" target="_blank">https://code.google.com/p/crypto-js/</a>) and the Stanford crypto library<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; (<a href="http://crypto.stanford.edu/sjcl/" target="_blank">http://crypto.stanford.edu/sjcl/</a>).<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Before I finish the whole implementation I have some questions:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; - Currently crypto-js doesn&#39;t have support for GCM or ECC, but sjcl has.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; That&#39;s the reason why my choice was sjcl instead of crypto-js, but if<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; you have another good alternative,  let me know.<br>
&gt;&gt;&gt;&gt;&gt;&gt; +1 for sjcl if you think it offers everything we need<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; - Create wrappers or not? If you read the unit tests at first glance (at<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; least for me) looks like is too much. Most part of developers are<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; looking for security by default.<br>
&gt;&gt;&gt;&gt;&gt;&gt; +1 I would like us to provide methods like encrypt or decrypt which use default values which we choose because we have researched and feel they are the best option for devs.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; My idea is not to hide the library, but<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; provide a simple interface like:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Crypto crypto = new Crypto;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; ciphertext = crypto. encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; crypto.decrypt(ciphertext);<br>
&gt;&gt;&gt;&gt;&gt;&gt; I agree with this syntax in spirit but not execution. ;) JS doesn&#39;t have types like Crypto crypto, just var crypto. I would also prefer to follow the pattern we use in the rest of AeroGear.js to allow for instantiation without the use of the `new` keyword&#39;. You can see the source of the other modules or ping me for details.<br>

&gt;&gt;&gt;&gt;&gt; Now that I think about it, if this is just for encryption and decryption, I think this would look better and be more user friendly in AeroGear.core. That way, a user doesn&#39;t even have to instantiate and object, they just use our shortcut methods to call into sjcl. For example:<br>

&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; AeroGear.encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt;&gt;&gt; AeroGear.decrypt( cipherText );<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Those should be really easy to implement too and that will keep the size of the library way down. :)<br>
&gt;&gt;&gt;&gt; that could be nice,  but what if a user doesn&#39;t want those methods,  i wonder if it would make sense to have a security.core or something,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; That would be fine. We could build it as a separate module that just gets tacked onto Core if they want it that way they can leave it and sjcl out if they don&#39;t want it.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Advanced users looking for another kind of algorithm/implementation or<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; whatever would still be able to make use of the plain and straight<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; crypto library.<br>
&gt;&gt;&gt;&gt;&gt;&gt; +1 and we should provide examples at least in the docs<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; - What is the best way to package this library? Bower?<br>
&gt;&gt;&gt;&gt;&gt;&gt; If we&#39;re going to create some sort of wrapper object then it would just be part of AeroGear.js and by doing that would be packaged and available via Bower.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Thoughts?<br>
&gt;&gt;&gt;&gt;&gt;&gt; Great start and great thoughts!<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; abstractj<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt; Lucas Holmquist &lt;mailto:<a href="mailto:lholmqui@redhat.com">lholmqui@redhat.com</a>&gt;<br>
&gt;&gt;&gt; September 23, 2013 3:04 PM<br>
&gt;&gt;&gt; On Sep 23, 2013, at 2:01 PM, Kris Borchers &lt;<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Sep 23, 2013, at 12:40 PM, Kris Borchers &lt;<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On Sep 20, 2013, at 10:05 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Good morning slackland, following with the plan I started a simple draft<br>
&gt;&gt;&gt;&gt;&gt;&gt; for JavaScript (<a href="https://github.com/abstractj/cryptoparty-js" target="_blank">https://github.com/abstractj/cryptoparty-js</a>) we have<br>
&gt;&gt;&gt;&gt;&gt;&gt; several alternatives outside there the most popular are Crypto-js<br>
&gt;&gt;&gt;&gt;&gt;&gt; (<a href="https://code.google.com/p/crypto-js/" target="_blank">https://code.google.com/p/crypto-js/</a>) and the Stanford crypto library<br>
&gt;&gt;&gt;&gt;&gt;&gt; (<a href="http://crypto.stanford.edu/sjcl/" target="_blank">http://crypto.stanford.edu/sjcl/</a>).<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Before I finish the whole implementation I have some questions:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; - Currently crypto-js doesn&#39;t have support for GCM or ECC, but sjcl has.<br>
&gt;&gt;&gt;&gt;&gt;&gt; That&#39;s the reason why my choice was sjcl instead of crypto-js, but if<br>
&gt;&gt;&gt;&gt;&gt;&gt; you have another good alternative,  let me know.<br>
&gt;&gt;&gt;&gt;&gt; +1 for sjcl if you think it offers everything we need<br>
&gt;&gt;&gt;&gt;&gt;&gt; - Create wrappers or not? If you read the unit tests at first glance (at<br>
&gt;&gt;&gt;&gt;&gt;&gt; least for me) looks like is too much. Most part of developers are<br>
&gt;&gt;&gt;&gt;&gt;&gt; looking for security by default.<br>
&gt;&gt;&gt;&gt;&gt; +1 I would like us to provide methods like encrypt or decrypt which use default values which we choose because we have researched and feel they are the best option for devs.<br>
&gt;&gt;&gt;&gt;&gt;&gt; My idea is not to hide the library, but<br>
&gt;&gt;&gt;&gt;&gt;&gt; provide a simple interface like:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Crypto crypto = new Crypto;<br>
&gt;&gt;&gt;&gt;&gt;&gt; ciphertext = crypto. encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt;&gt;&gt;&gt; crypto.decrypt(ciphertext);<br>
&gt;&gt;&gt;&gt;&gt; I agree with this syntax in spirit but not execution. ;) JS doesn&#39;t have types like Crypto crypto, just var crypto. I would also prefer to follow the pattern we use in the rest of AeroGear.js to allow for instantiation without the use of the `new` keyword&#39;. You can see the source of the other modules or ping me for details.<br>

&gt;&gt;&gt;&gt; Now that I think about it, if this is just for encryption and decryption, I think this would look better and be more user friendly in AeroGear.core. That way, a user doesn&#39;t even have to instantiate and object, they just use our shortcut methods to call into sjcl. For example:<br>

&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; AeroGear.encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt;&gt; AeroGear.decrypt( cipherText );<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Those should be really easy to implement too and that will keep the size of the library way down. :)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; that could be nice,  but what if a user doesn&#39;t want those methods,  i wonder if it would make sense to have a security.core or something,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Advanced users looking for another kind of algorithm/implementation or<br>
&gt;&gt;&gt;&gt;&gt;&gt; whatever would still be able to make use of the plain and straight<br>
&gt;&gt;&gt;&gt;&gt;&gt; crypto library.<br>
&gt;&gt;&gt;&gt;&gt; +1 and we should provide examples at least in the docs<br>
&gt;&gt;&gt;&gt;&gt;&gt; - What is the best way to package this library? Bower?<br>
&gt;&gt;&gt;&gt;&gt; If we&#39;re going to create some sort of wrapper object then it would just be part of AeroGear.js and by doing that would be packaged and available via Bower.<br>
&gt;&gt;&gt;&gt;&gt;&gt; Thoughts?<br>
&gt;&gt;&gt;&gt;&gt; Great start and great thoughts!<br>
&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt; abstractj<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt; Kris Borchers &lt;mailto:<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt;<br>
&gt;&gt;&gt; September 23, 2013 3:01 PM<br>
&gt;&gt;&gt; On Sep 23, 2013, at 12:40 PM, Kris Borchers &lt;<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Sep 20, 2013, at 10:05 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Good morning slackland, following with the plan I started a simple draft<br>
&gt;&gt;&gt;&gt;&gt; for JavaScript (<a href="https://github.com/abstractj/cryptoparty-js" target="_blank">https://github.com/abstractj/cryptoparty-js</a>) we have<br>
&gt;&gt;&gt;&gt;&gt; several alternatives outside there the most popular are Crypto-js<br>
&gt;&gt;&gt;&gt;&gt; (<a href="https://code.google.com/p/crypto-js/" target="_blank">https://code.google.com/p/crypto-js/</a>) and the Stanford crypto library<br>
&gt;&gt;&gt;&gt;&gt; (<a href="http://crypto.stanford.edu/sjcl/" target="_blank">http://crypto.stanford.edu/sjcl/</a>).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Before I finish the whole implementation I have some questions:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; - Currently crypto-js doesn&#39;t have support for GCM or ECC, but sjcl has.<br>
&gt;&gt;&gt;&gt;&gt; That&#39;s the reason why my choice was sjcl instead of crypto-js, but if<br>
&gt;&gt;&gt;&gt;&gt; you have another good alternative,  let me know.<br>
&gt;&gt;&gt;&gt; +1 for sjcl if you think it offers everything we need<br>
&gt;&gt;&gt;&gt;&gt; - Create wrappers or not? If you read the unit tests at first glance (at<br>
&gt;&gt;&gt;&gt;&gt; least for me) looks like is too much. Most part of developers are<br>
&gt;&gt;&gt;&gt;&gt; looking for security by default.<br>
&gt;&gt;&gt;&gt; +1 I would like us to provide methods like encrypt or decrypt which use default values which we choose because we have researched and feel they are the best option for devs.<br>
&gt;&gt;&gt;&gt;&gt; My idea is not to hide the library, but<br>
&gt;&gt;&gt;&gt;&gt; provide a simple interface like:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Crypto crypto = new Crypto;<br>
&gt;&gt;&gt;&gt;&gt; ciphertext = crypto. encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt;&gt;&gt; crypto.decrypt(ciphertext);<br>
&gt;&gt;&gt;&gt; I agree with this syntax in spirit but not execution. ;) JS doesn&#39;t have types like Crypto crypto, just var crypto. I would also prefer to follow the pattern we use in the rest of AeroGear.js to allow for instantiation without the use of the `new` keyword&#39;. You can see the source of the other modules or ping me for details.<br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt; Now that I think about it, if this is just for encryption and decryption, I think this would look better and be more user friendly in AeroGear.core. That way, a user doesn&#39;t even have to instantiate and object, they just use our shortcut methods to call into sjcl. For example:<br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt; AeroGear.encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt; AeroGear.decrypt( cipherText );<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Those should be really easy to implement too and that will keep the size of the library way down. :)<br>
&gt;&gt;&gt;&gt;&gt; Advanced users looking for another kind of algorithm/implementation or<br>
&gt;&gt;&gt;&gt;&gt; whatever would still be able to make use of the plain and straight<br>
&gt;&gt;&gt;&gt;&gt; crypto library.<br>
&gt;&gt;&gt;&gt; +1 and we should provide examples at least in the docs<br>
&gt;&gt;&gt;&gt;&gt; - What is the best way to package this library? Bower?<br>
&gt;&gt;&gt;&gt; If we&#39;re going to create some sort of wrapper object then it would just be part of AeroGear.js and by doing that would be packaged and available via Bower.<br>
&gt;&gt;&gt;&gt;&gt; Thoughts?<br>
&gt;&gt;&gt;&gt; Great start and great thoughts!<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; abstractj<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt; Kris Borchers &lt;mailto:<a href="mailto:kris@redhat.com">kris@redhat.com</a>&gt;<br>
&gt;&gt;&gt; September 23, 2013 2:40 PM<br>
&gt;&gt;&gt; On Sep 20, 2013, at 10:05 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Good morning slackland, following with the plan I started a simple draft<br>
&gt;&gt;&gt;&gt; for JavaScript (<a href="https://github.com/abstractj/cryptoparty-js" target="_blank">https://github.com/abstractj/cryptoparty-js</a>) we have<br>
&gt;&gt;&gt;&gt; several alternatives outside there the most popular are Crypto-js<br>
&gt;&gt;&gt;&gt; (<a href="https://code.google.com/p/crypto-js/" target="_blank">https://code.google.com/p/crypto-js/</a>) and the Stanford crypto library<br>
&gt;&gt;&gt;&gt; (<a href="http://crypto.stanford.edu/sjcl/" target="_blank">http://crypto.stanford.edu/sjcl/</a>).<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Before I finish the whole implementation I have some questions:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; - Currently crypto-js doesn&#39;t have support for GCM or ECC, but sjcl has.<br>
&gt;&gt;&gt;&gt; That&#39;s the reason why my choice was sjcl instead of crypto-js, but if<br>
&gt;&gt;&gt;&gt; you have another good alternative,  let me know.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; +1 for sjcl if you think it offers everything we need<br>
&gt;&gt;&gt;&gt; - Create wrappers or not? If you read the unit tests at first glance (at<br>
&gt;&gt;&gt;&gt; least for me) looks like is too much. Most part of developers are<br>
&gt;&gt;&gt;&gt; looking for security by default.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; +1 I would like us to provide methods like encrypt or decrypt which use default values which we choose because we have researched and feel they are the best option for devs.<br>
&gt;&gt;&gt;&gt; My idea is not to hide the library, but<br>
&gt;&gt;&gt;&gt; provide a simple interface like:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Crypto crypto = new Crypto;<br>
&gt;&gt;&gt;&gt; ciphertext = crypto. encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt;&gt; crypto.decrypt(ciphertext);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I agree with this syntax in spirit but not execution. ;) JS doesn&#39;t have types like Crypto crypto, just var crypto. I would also prefer to follow the pattern we use in the rest of AeroGear.js to allow for instantiation without the use of the `new` keyword&#39;. You can see the source of the other modules or ping me for details.<br>

&gt;&gt;&gt;&gt; Advanced users looking for another kind of algorithm/implementation or<br>
&gt;&gt;&gt;&gt; whatever would still be able to make use of the plain and straight<br>
&gt;&gt;&gt;&gt; crypto library.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; +1 and we should provide examples at least in the docs<br>
&gt;&gt;&gt;&gt; - What is the best way to package this library? Bower?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; If we&#39;re going to create some sort of wrapper object then it would just be part of AeroGear.js and by doing that would be packaged and available via Bower.<br>
&gt;&gt;&gt;&gt; Thoughts?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Great start and great thoughts!<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; abstractj<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;&gt; Bruno Oliveira &lt;mailto:<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt;<br>
&gt;&gt;&gt; September 20, 2013 12:05 PM<br>
&gt;&gt;&gt; Good morning slackland, following with the plan I started a simple draft<br>
&gt;&gt;&gt; for JavaScript (<a href="https://github.com/abstractj/cryptoparty-js" target="_blank">https://github.com/abstractj/cryptoparty-js</a>) we have<br>
&gt;&gt;&gt; several alternatives outside there the most popular are Crypto-js<br>
&gt;&gt;&gt; (<a href="https://code.google.com/p/crypto-js/" target="_blank">https://code.google.com/p/crypto-js/</a>) and the Stanford crypto library<br>
&gt;&gt;&gt; (<a href="http://crypto.stanford.edu/sjcl/" target="_blank">http://crypto.stanford.edu/sjcl/</a>).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Before I finish the whole implementation I have some questions:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; - Currently crypto-js doesn&#39;t have support for GCM or ECC, but sjcl has.<br>
&gt;&gt;&gt; That&#39;s the reason why my choice was sjcl instead of crypto-js, but if<br>
&gt;&gt;&gt; you have another good alternative, let me know.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; - Create wrappers or not? If you read the unit tests at first glance (at<br>
&gt;&gt;&gt; least for me) looks like is too much. Most part of developers are<br>
&gt;&gt;&gt; looking for security by default. My idea is not to hide the library, but<br>
&gt;&gt;&gt; provide a simple interface like:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Crypto crypto = new Crypto;<br>
&gt;&gt;&gt; ciphertext = crypto. encrypt(&quot;blah&quot;);<br>
&gt;&gt;&gt; crypto.decrypt(ciphertext);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Advanced users looking for another kind of algorithm/implementation or<br>
&gt;&gt;&gt; whatever would still be able to make use of the plain and straight<br>
&gt;&gt;&gt; crypto library.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; - What is the best way to package this library? Bower?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thoughts?<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; abstractj<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
<br>
<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br></div></div>