Again, these are cosmetic changes, I am not changing a single variable name or functionality of the script. But the stuff I tested is compatible with.
In addition, I wanted something that was publicly proven and recognized as being fairly secure. The script runs within cscript. This implementation inlines many of the functions that would make the implementation easier to read.
Are you using PRNG to generate those detections? The output of the test looks like this: RC4 Test Harness Plaintext was: "To be or not to be: that is the question, whether tis nobler in the mind to suffer the slings and arrows of outrageous fortune. GenerateKey obj.