Live data from Hacker News

Implementing RSA from Scratch in JavaScript

coderoasis.com

1–10 of 27 posts

Re: Implementing RSA from Scratch in JavaScript

#2
This isn't a particularly good way to learn RSA, and Javascript isn't a good environment to teach it. It's better to use Python, which at least has bignums. And obviously, seeing a wrong implementation of RSA isn't at all essential for implementing secure systems, contrary to the article's claims. Few people will actually need to implement RSA, and for those people, all those details that the article gets wrong really matter.

The code here doesn't even work, partly because it calls euclideanAlgorithm when the author means extendedEuclidean, but also because Javascript only has 53-bit integers and the modular-multiplication code uses [edit] 60-bit intermediates when N is 30 bits long.

Re: Implementing RSA from Scratch in JavaScript

#4

This isn't a particularly good way to learn RSA, and Javascript isn't a good environment to teach it. It's better to use Python, which at least has bignums. And obviously, seeing a wrong implementation of RSA isn't at all essential for implementing secure systems, contrary to the article's claims. Few people will actually need to implement RSA, and for those people, all those details that the article gets wrong reall…

The article seems to be generated by GPT. Its quality is remarkably low.

Re: Implementing RSA from Scratch in JavaScript

#5

This isn't a particularly good way to learn RSA, and Javascript isn't a good environment to teach it. It's better to use Python, which at least has bignums. And obviously, seeing a wrong implementation of RSA isn't at all essential for implementing secure systems, contrary to the article's claims. Few people will actually need to implement RSA, and for those people, all those details that the article gets wrong reall…

Browsers have native bignum support: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: Implementing RSA from Scratch in JavaScript

#6

This isn't a particularly good way to learn RSA, and Javascript isn't a good environment to teach it. It's better to use Python, which at least has bignums. And obviously, seeing a wrong implementation of RSA isn't at all essential for implementing secure systems, contrary to the article's claims. Few people will actually need to implement RSA, and for those people, all those details that the article gets wrong reall…

Javascript has native BigInts, and there is already an RSA implementation using them: https://github.com/i404788/tiny-rsa

Re: Implementing RSA from Scratch in JavaScript

#7

This isn't a particularly good way to learn RSA, and Javascript isn't a good environment to teach it. It's better to use Python, which at least has bignums. And obviously, seeing a wrong implementation of RSA isn't at all essential for implementing secure systems, contrary to the article's claims. Few people will actually need to implement RSA, and for those people, all those details that the article gets wrong reall…

All common browsers support BigInt in Javascript:

https://caniuse.com/?search=BigInt

Re: Implementing RSA from Scratch in JavaScript

#9

This isn't a particularly good way to learn RSA, and Javascript isn't a good environment to teach it. It's better to use Python, which at least has bignums. And obviously, seeing a wrong implementation of RSA isn't at all essential for implementing secure systems, contrary to the article's claims. Few people will actually need to implement RSA, and for those people, all those details that the article gets wrong reall…

JS not only has BigInt, but it also has TypedArrays too. It even used to have SIMD support before they dropped it for WASM.
Post reply on HN