Algorithm Projects with Go

Public Key Cryptography with RSA you own this product

This project is part of the liveProject series Six Small Algorithm Projects with Go
the modulus operator • arrays • slices • integer division • exponentiation
skills learned
randomization • GCD and LCM • fast exponentiation • working with prime numbers • factoring • primality testing • RSA encryption
Rod Stephens
1 week · 6-8 hours per week · BEGINNER

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • share your subscription with another person
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases

lite $19.99 per month

  • access to all Manning books, including MEAPs!


5, 10 or 20 seats+ for your team - learn more

Look inside

You’re the new head of IT at The Fright Stuff, a small Halloween store, and it’s up to you to prevent a scary security breach! To ensure your customers’ sensitive data is secure, you’ll build an RSA public key encryption program. Along the way, you’ll learn interesting mathematical techniques such as calculating greatest common divisors and least common multiples, performing fast exponentiation, building a sieve of Eratosthenes, testing for primality, and other vital encryption skills. When you’re done, your customers’ data will be safer than ever before, and you’ll have learned essential skills for RSA encryption.

This project is designed for learning purposes and is not a complete, production-ready application or solution.

book resources

When you start your liveProject, you get full access to the following books for 90 days.

project author

Rod Stephens

Rod Stephens started out as a mathematician but discovered the fun of algorithms and has been programming ever since. Rod was a Microsoft Visual Basic Most Valuable Professional (MVP) for 15 years, has spoken to user groups and conferences, and has taught introductory programming courses. He has written more than 35 books including Essential Algorithms: A Practical Approach to Computer Algorithms Using Python and C# and Beginning Software Engineering, both of which include material related to this series of liveProjects.


This liveProject is for Go programmers, from beginning level to advanced, who want to learn how to build an RSA encryption algorithm. To begin these liveProjects you’ll need to be familiar with the following:


  • A Go compiler (such as Visual Studio Code or Online GDB)
  • Basic math
  • Basic Go features (including arrays, structs, and slices)

you will learn

In this liveProject, you’ll learn how RSA encryption algorithms work and the skills to build them, including:

  • Randomization
  • Calculating GCD and LCM
  • Fast exponentiation
  • Working with prime numbers
  • Factoring
  • Primality testing


You choose the schedule and decide how much time to invest as you build your project.
Project roadmap
Each project is divided into several achievable steps.
Get Help
While within the liveProject platform, get help from other participants and our expert mentors.
Compare with others
For each step, compare your deliverable to the solutions by the author and other participants.
book resources
Get full access to select books for 90 days. Permanent access to excerpts from Manning products are also included, as well as references to other resources.

choose your plan


only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • Public Key Cryptography with RSA project for free