karl wrote, On 2009-01-26 12:39: > Help: Does anyone know of an XPCOM component that will encrypt/decrypt > a XUL string using RSA encryption. > > I can do it using javascript RSA libraries <http://www-cs- > students.stanford.edu/~tjw/jsbn/>, but they are too slow (250ms) when > decrypting
250ms to RSA DEcrypt in JS? That's VERY good! I'm impressed. > (I need to decrypt a bunch of strings (~30) at a time). These are small strings, right? Less than 110 bytes each? Remember that RSA can only encrypt data that is smaller than the size of the key, at least 11 bytes smaller. That fact, plus the fact that it's slow, is why almost nobody ever uses RSA to encrypt DATA. RSA is used to encrypt a KEY (e.g. an AES key), and that key is used to do all the data encryption because the algorithm for that key is fast and can handle data larger than the key size itself. > I am lead to believe that the NSS component <http://www.mozilla.org/ > projects/security/pki/nss/nss-3.11/nss-3.11-algorithms.html> contains > the appropriate functionality (RSA keygen/encryption/decryption) but I > don't know how to access it from a XUL application. > > I've also found the WeaveCrypto XPCOM component used by mozilla weave > <http://labs.mozilla.com/projects/weave/> which contains AES > encryption but also an RSA generateKeyPair function, but as far as I > can tell does not encrypt or decrypt using RSA, it only generates a > key pair? I wish I could help with the XPCOM interface question, but I'm not familiar with the XPCOM crypto interfaces available. -- dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto