# Euler's totient function and Carmichael's totient function in RSA [duplicate]

I'm a high school student taking IB and I'm doing my EE on Maths, more specifically on the effectiveness of Euler's totient function and Carmichael's totient function in RSA.

1. Am I right in thinking that Euler's and Carmichael's can be used interchangeably to generate the public key in RSA?
2. To compare their 'effectiveness' I will first compare the amount of time it takes to generate a public key using each function based on time complexity. Secondly, I want to compare the security of the public key (meaning 'how difficult it is to guess the private key given the public key'). But how? Is there an algorithm to use to test the security of an encryption key?

Many thanks!

## marked as duplicate by Ilmari Karonen, kelalaka, AleksanderRas, Squeamish Ossifrage, Maarten Bodewes♦ encryption StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 18 at 23:32

Yes. The requirement is that the public exponent $$e$$ have an inverse modulo $$\phi(n)$$ or $$\lambda(n)$$, whichever you use—and the two numbers share prime factorization, differing only in multiplicity, so $$e$$ is coprime with $$\phi(n)$$ iff $$e$$ is coprime with $$\lambda(n)$$.
However, this is all about generation of the prime factors. The public exponent $$e$$ should be a fixed constant like 3 or 65537; then the private exponent $$d$$ solves either $$e\cdot d \equiv 1 \pmod{\phi(n)}$$ or $$e\cdot d \equiv 1 \pmod{\lambda(n)}$$. If you use $$\phi(n)$$, $$d$$ might be larger, so the private key operation costs more to do the same thing. That is, the only difference the choice of $$\phi(n)$$ vs. $$\lambda(n)$$ makes is efficiency of the private key operation.