I am really happy that this is here. Although RSA is almost trivial to implement, it is nice to have a version that anyone (eg, a very lazy or tired student) can just use without having to set up anything. However, I would prefer that Minh eventually comment on this since he knows the crypto class structure of sage better than I do.

Note that examples are completely missing from the docstrings, so this cannot go in "as is" and I am marking this as "needs work".

Rather than listing what needs to be done, let me try to write a reviewer patch that would bring gauravluthra's implementation up to the standard that is expected of any code that goes into the Sage library. In case you haven't done so, please refer to the Developer's Guide for guidelines on contributing to Sage.

The name RSA for the class is misleading because the stated purpose of this class is to be an implementation of RSA for educational purposes. We don't want to give the misleading impression that srsa.py can be used for industrial purposes. I'll change that name to ToyRSA in my reviewer patch. By the way, what does the letter "s" in "srsa.py" mean?

PS: There's a simplified version of RSA called Kid RSA that is suitable for teaching cryptography to high school students. See ​this book (which is in progress) for details.