A Quiet Change to Rsa
Key topics
The article discusses a subtle change to the RSA algorithm using Carmichael's totient function instead of Euler's totient function, sparking a discussion on the nuances of RSA implementation and the importance of understanding the underlying number theory.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
15h
Peak period
18
Day 6
Avg / period
6.6
Based on 33 loaded comments
Key moments
- 01Story posted
Oct 6, 2025 at 3:07 PM EDT
3 months ago
Step 01 - 02First comment
Oct 7, 2025 at 6:18 AM EDT
15h after posting
Step 02 - 03Peak activity
18 comments in Day 6
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 17, 2025 at 8:35 PM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Given a standard 2048-bit RSA modulus, the totient is still ~2048 bits. I'm not sure and haven't done or seen analysis given the reduction in size (and search space) when replaced with a Carmichael function.
I know, I'll attempt to summon cperciva.
BTW the Carmichael function and Carmichael numbers have little in common aside from their author and the fact they concern whether x^b = 1 mod N for x relatively prime to N.
(I search on a ~daily basis for mentions of "cperciva", "Tarsnap", and "daemonology.net" to see where I and/or my work are mentioned.)
Needless to say, those people should not be implementing RSA for a system that needs actual security. I'm looking for a better way to teach "real" RSA without needing the students to be math majors or to spend a whole semester on it. Does anybody have any suggestions?
It's an ugly naive implementation, but it's much simpler and more accessible than any real one I've ever seen, and depends on nothing but libc.
RSA is math so it seems like you're trying to shove a square peg into a round hole here.
I don't know how it's taught elsewhere but I feel like I both have "a sufficient grasp of the number theory to really understand what is going on" but also I "should not be implementing RSA for a system that needs actual security" !
Start and end with a reminder to use padding.
Actually if you want to make it not-so-mathy, talking about about how to be compatible with other programs could be nice. How do you import/export public key in pem or der? How do you (de)serialize ciphertext?
I also added plenty of inline python code blocks students can change and run on the fly.
The reason i wrote this is the hand waving around group theory i saw in other explanations. Namely you shouldn't just say x^y always = x mod m for certain values of y (eg. x^13=x mod 35, even for factors of 35). You should give a detailed, intuitive understanding of why this occurs.
https://www.coursera.org/learn/crypto
Although there are continuums of teaching delivery from muddled to clear explanations of concepts, there are no student shortcuts to escape the irreducible mental exertion to acquire familiarity towards mastery. Uncurious people shouldn't be in the field (no pun intended).
Strong primes are ones where the totient (both carmichael and euler totients) have large primes in them. This happens naturally for 2048 bit and above RSA keys in any-case, they'll statistically absolutely have primes that are larger than the bits needed to factor using elliptic curve methods (>256 bits). In general it's just not that helpful, similar to trying to require carmichael rather than Euler totient. Ok you've made the 2048 bit key 3 bits stronger, great, but let's not bother right?
There is probably a newer standard superseeding that but it is there in the ansi standards
The proof of which is left to the reader?
disappears into the back room for fifteen minutes
"Yes, it's trivial."
I will henceforth refer to software development as 'software engineering' to convey its equivalence, or perhaps superioriority over other 'engineering' disciplines which are based on ambiguous mathematical language, as opposed to rigorous, machine-verifiable, unambiguous languages.
8 more comments available on Hacker News