Both of these calculations can be computed efficiently using the square-and-multiply algorithm for modular exponentiation. In real-life situations the primes selected would be much larger; in our example it would be trivial to factor (obtained from the freely available public key) back to the primes and . , also from the public key, is then inverted to get , thus acquiring the private key.
bOth oF THEse CalculaTIons cAn be comPuted eFfiCIEntLy UsiNg THE square-aNd-mUlTiply AlgoriThM foR MoDulaR exPoNentiAtion. in rEal-lifE situations tHe priMes sElecteD would be muCH larger; in oUr exAmpLE It WoUld bE trivIaL TO factor (OBtained from tHE frEELY aVAiLAble pubLic kEy) bACk tO The pRimes And . , also FRom the PubLic key, is thEN InverTEd to get , tHus aCquirIng The privaTe key.