Question: I'm on OSX, with protractor version 1.3.1 installed. If I put browser.debugger() in my test and run with

$ protractor debug test/protractor.conf.js

I go into the debugger screen. Then I hit "c" and it seems to stop at my breakpoint.
However, nothing seems to be in scope, everything comes up as undefined.

debug> browser
ReferenceError: browser is not defined

If I enter 'repl', I go into a node repl loop (I think?) and I can look at the browser object, but none of my local variables from the test seem to be in scope, they all come up as undefined.

Any suggestions?

Answer: 
Most of the time is likely be taken by the RSA decryption of the session keys. RSA is much slower than AES. Probably the best thing to do is to create a session single key for multiple fields and decrypt that once. Currently they are all dependent on the same private key anyway, so it would not matter much with regards to key management. You are already providing a random IV for each field, so the encryption itself should be safe. 

Another small change that you could make is to actually use AES. `MCRYPT_RIJNDAEL_256` is Rijndael with a block size of 256 bits instead of 128 bits. Rijndael with a block size of 128 bits (`MCRYPT_RIJNDAEL_1282`)is equal to AES - currently you would not be able to decrypt with an AES only library. The key size depends on the size of the session key.

Another fix could be to switch to an Elliptic Curve EC key pair and use ECIES. This is much faster for decryption (and only slightly slower for encryption). This would require a steep learning curve if you don't know Elliptic Curve cryptography yet.

Finally, OpenSSL would be faster on Intel platforms compared to mcrypt, which does not support AES-NI instruction set (currently and to my knowledge - the C-lib has not been updated for years on end). However, the PHP OpenSSL API is very limited and currently I would not be able to assist here.
Maybe you can use multiple ajax request to simulate multithreading decryption.