The main topic of this work is cryptanalysis of RSA and its variants. In the first chapter we describe RSA in general and introduce some of its properties. Next two chapters contain the main work. In the second chapter we analyze some attacks on RSA and explore what to avoid in RSA implementation. Through examining the attacks, in small private exponent attacks we determine the lower bound for RSA private exponent, and in partial key exposure attacks we highlight the importance of keeping bits of the secret key secret. In the third chapter we introduce some of the RSA variants which are more effective then classic RSA in the sense of the decryption price, key generation price or memory. We explore the attacks on these variants and discover what classic RSA attacks can we use either directly or after generalization. We also explore some new attacks which use specific properties of the given variant.