3 ms·
I see the peer comments regarding big ints, but the OP is still right in that the presented code doesn't work, for more than one reason.
by tyingq 3y ago
I see the peer comments regarding big ints, but the OP is still right in that the presented code doesn't work, for more than one reason.
- shiomiru 3y agoBesides, the code does not use BigInts at all, so the fact that JavaScript has them does not help much. I agree with the sibling commenter that this seems to be automatically generated. The disclaimer is weird, you don't just use a random rsa implementation found in a blog post "with careful consideration and expert guidance". The article's structure is weird, it's just a bullet list of steps and then code dump. It gets many details wrong (code won't run, explanation seems to be mixing up euler & carmichael totients, ...). etc. It is somewhat scary that this got to the front page at all.
- throwayaw84330 3y ago100% agree. Many red flags here: - Look at the text below the headers "Explaining RSA Cryptography" and "Explaining RSA Cryptography with JavaScript". Both paragraphs start with the exact same text. I believe there are far more chances that this was generated by a machine rather than a human. - Look at the math! There is a code block where it says "scssCopy" -- the "Copy" is generally garbage from machine generated text+code snippets. - The code has a missing function, `lcm`. Author has forgotten to include it, which can be a human or machine error. This kind of episode makes me wonder if I should continue posting, suggest that people filter everything through an LLM, or just resign to the botspamcallypse.