You are currently browsing the tag archive for the ‘RSA codes’ tag.


Cracking RSA Code – The World’s Most Important Code? 

RSA code is the basis of all important data transfer.  Encrypted data that needs to be sent between two parties, such as banking data or secure communications relies on the techniques of RSA code.  RSA code was invented in 1978 by three mathematicians (Rivest, Shamir and Adleman).  Cryptography relies on numerous mathematical techniques from Number Theory – which until the 1950s was thought to be a largely theoretical pursuit with few practical applications.  Today RSA code is absolutely essential to keeping digital communications safe.

To encode a message using the RSA code follow the steps below:

1) Choose 2 prime numbers p and q (let’s say p=7 and q=5)

2) Multiply these 2 numbers together (5×7 = 35).  This is the public key (m) – which you can let everyone know. So m = 35.

3) Now we need to use an encryption key (e).   Let’s say that e = 5.  e is also made public. (There are restrictions as to what values e can take – e must actually be relatively prime to (p-1)(q-1) )

4) Now we are ready to encode something.  First we can assign 00 = A, 01 = B, 02 = C, 03 = D, 04 = E etc. all the way to 25 = Z.  So the word CODE is converted into: 02, 14, 03, 04.

5) We now use the formula: C = ye (mod m) where y is the letter we want to encode.  So for the letters CODE we get: C = 025 = 32 (mod 35). C = 145 = 537824 which is equivalent to 14 (mod 35). C = 035 = 33 (mod 35).  C = 045 = 1024 which is equivalent to 09 (mod 35).  (Mod 35 simply mean we look at the remainder when we divide by 35).  Make use of an online modulus calculator!   So our coded word becomes: 32 14 33 09.


This form of public key encryption forms the backbone of the internet and the digital transfer of information.  It is so powerful because it is very quick and easy for computers to decode if they know the original prime numbers used, and exceptionally difficult to crack if you try and guess the prime numbers.  Because of the value of using very large primes there is a big financial reward on offer for finding them.  The world’s current largest prime number is over 17 million digits long and was found in February 2013.   Anyone who can find a prime 100 million digits long will win $100,000.

To decode the message 11 49 41 we need to do the following:

1) In RSA encryption we are given both m and e. These are public keys.  For example we are given that m = 55 and e = 27.  We need to find the two prime numbers that multiply to give 55.  These are p = 5 and q = 11.

2) Calculate (p-1)(q-1).  In this case this is (5-1)(11-1) = 40.  Call this number theta.

3) Calculate a value d such that de = 1 (mod theta).  We already know that e is 27.  Therefore we want 27d = 1 (mod 40).  When d = 3 we have 27×3 = 81 which is 1 (mod 40).  So d = 3.

4) Now we can decipher using the formula: y = C^d (mod m), where C is the codeword.  So for the cipher text 11 49 41:  y = 113 = 11 (mod 55).  y = 493 = 04 (mod 55). y = 413 = 6 (mod 55).

5) We then convert these numbers back to letters using A = 00, B = 01 etc.  This gives the decoded word as: LEG.

If you enjoyed this post you might also like:

How Are Prime Numbers Distributed? Twin Primes Conjecture. Discussion on studying prime numbers.

Cracking ISBN and Credit Card Codes. The mathematics behind ISBN codes and credit card codes

IB Revision

Screen Shot 2018-03-19 at 4.35.19 PM

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

Screen Shot 2018-03-19 at 4.42.05 PM.pngThe Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial.  Really useful!

Screen Shot 2019-07-27 at 10.02.40 AM

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions.  This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.

Website Stats


IB HL Paper 3 Practice Questions (120 page pdf)

IB HL Paper 3 Practice Questions 

Seventeen full investigation questions – each one designed to last around 1 hour, and totaling around 40 pages and 600 marks worth of content.  There is also a fully typed up mark scheme.  Together this is around 120 pages of content.

Available to download here.

IB Maths Exploration Guide

IB Maths Exploration Guide

A comprehensive 63 page pdf guide to help you get excellent marks on your maths investigation. Includes:

  1. Investigation essentials,
  2. Marking criteria guidance,
  3. 70 hand picked interesting topics
  4. Useful websites for use in the exploration,
  5. A student checklist for top marks
  6. Avoiding common student mistakes
  7. A selection of detailed exploration ideas
  8. Advice on using Geogebra, Desmos and Tracker.

Available to download here.

Modelling Guide

IB Exploration Modelling Guide 

A 50 page pdf guide full of advice to help with modelling explorations – focusing in on non-calculator methods in order to show good understanding.

Modelling Guide includes:

Linear regression and log linearization, quadratic regression and cubic regression, exponential and trigonometric regression, comprehensive technology guide for using Desmos and Tracker.

Available to download here.

Statistics Guide

IB Exploration Statistics Guide

A 55 page pdf guide full of advice to help with modelling explorations – focusing in on non-calculator methods in order to show good understanding.

Statistics Guide includes: Pearson’s Product investigation, Chi Squared investigation, Binomial distribution investigation, t-test investigation, sampling techniques, normal distribution investigation and how to effectively use Desmos to represent data.

Available to download here.

IB Revision Notes

IB Revision Notes

Full revision notes for SL Analysis (60 pages), HL Analysis (112 pages) and SL Applications (53 pages).  Beautifully written by an experienced IB Mathematics teacher, and of an exceptionally high quality.  Fully updated for the new syllabus.  A must for all Analysis and Applications students!

Available to download here.

Recent Posts

Follow IB Maths Resources from British International School Phuket on