Using Crypto APIs from Add-on (in Javascript)

View: New views
3 Messages — Rating Filter:   Alert me  

Using Crypto APIs from Add-on (in Javascript)

by Dominik-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I am developing a JavaScript-based Firefox add-on which could make use
of cryptography primitives like encrypting/decrypting short strings
with RSA/AES.

A pure JS implementation of those algorithms is way to slow. I have
come across the NSS library which seems to be part of the default
Firefox distributions. Is it possible to access its API (e.g. via
XPCOM) from my JavaScript extension code?

Best regards,
Dominik
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@...
https://lists.mozilla.org/listinfo/dev-tech-crypto

Re: Using Crypto APIs from Add-on (in Javascript)

by Kai Engert-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dominik schrieb:
> I am developing a JavaScript-based Firefox add-on which could make use
> of cryptography primitives like encrypting/decrypting short strings
> with RSA/AES.
>
> A pure JS implementation of those algorithms is way to slow. I have
> come across the NSS library which seems to be part of the default
> Firefox distributions. Is it possible to access its API (e.g. via
> XPCOM) from my JavaScript extension code?
>  

 From JS you can only access the subset of NSS that has been wrapped in
XPCOM interfaces. Most of the IDL files are below mozilla/security/manager
I fear there is nothing that can be used directly for encryption.
However, you might want to ping the Mozilla labs people who work on the
Weave project, I think they have faced similar challenges. Maybe you can
look at their code to get ideas. Or ask on irc.mozilla.org channel #labs

Kai



_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@...
https://lists.mozilla.org/listinfo/dev-tech-crypto

smime.p7s (4K) Download Attachment

Parent Message unknown Re: Using Crypto APIs from Add-on (in Javascript)

by Justin Dolske-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kai Engert wrote:

> However, you might want to ping the Mozilla labs people who work on the
> Weave project, I think they have faced similar challenges. Maybe you can
> look at their code to get ideas.

That would be: http://hg.mozilla.org/labs/weave/file/53e25c0c7e2e/src/

It's not a general-purpose crypto API, as it's tailored for Weave's usecase.

Justin
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@...
https://lists.mozilla.org/listinfo/dev-tech-crypto
LightInTheBox - Buy quality products at wholesale price!