The Naked Scientists
  • Login
  • Register
  • Podcasts
      • The Naked Scientists
      • eLife
      • Naked Genetics
      • Naked Astronomy
      • In short
      • Naked Neuroscience
      • Ask! The Naked Scientists
      • Question of the Week
      • Archive
      • Video
      • SUBSCRIBE to our Podcasts
  • Articles
      • Science News
      • Features
      • Interviews
      • Answers to Science Questions
  • Get Naked
      • Donate
      • Do an Experiment
      • Science Forum
      • Ask a Question
  • About
      • Meet the team
      • Our Sponsors
      • Site Map
      • Contact us

User menu

  • Login
  • Register
  • Home
  • Help
  • Search
  • Tags
  • Recent Topics
  • Login
  • Register
  1. Naked Science Forum
  2. General Science
  3. General Science
  4. Why are code makers and code breakers obsessed with prime numbers?
« previous next »
  • Print
Pages: [1]   Go Down

Why are code makers and code breakers obsessed with prime numbers?

  • 2 Replies
  • 7783 Views
  • 4 Tags

0 Members and 1 Guest are viewing this topic.

Offline Pseudoscience-is-malarkey (OP)

  • Hero Member
  • *****
  • 939
  • Activity:
    1%
  • Thanked: 32 times
Why are code makers and code breakers obsessed with prime numbers?
« on: 19/01/2023 06:56:06 »
This seems to be the case in both fiction and reality.
Logged
 



Offline evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 11033
  • Activity:
    8%
  • Thanked: 1486 times
Re: Why are code makers and code breakers obsessed with prime numbers?
« Reply #1 on: 19/01/2023 09:54:46 »
Prime numbers have many neat mathematical properties which do not apply to other "composite" numbers.

One of the simplest pseudo-random number generators is xn+1 = (a*xn + c) mod m
- It is important that constants a, b and c be relatively prime, otherwise the sequence will repeat long before it has generated all m values.
- Using prime numbers for m has the advantage that all bits of the generated sequence have a long period before they repeat
https://en.wikipedia.org/wiki/Linear_congruential_generator

Another application for prime numbers depends on the fact that for conventional computers, it is hard to factor large numbers
- If the number has just 2 large prime factors
- If the number has smaller factors, it is much easier to factorise (especially if there are many factors)
- In theory, a quantum computer may be able to factor large numbers much more quickly than a classical computer - but it will need a few thousand qubits.
https://en.wikipedia.org/wiki/RSA_(cryptosystem)

Another role that prime numbers play here is that raising a number to a high power modulo a prime number generates a unique value.

Note that some of these algorithms use the weaker requirement of being relatively prime, not specifically a prime.

It is hard to prove that a number is prime, but there are practical tests for pseudoprimes, which can determine that a number is prime for all practical purposes.
- These tests are useful for generating public/private key pairs.
https://en.wikipedia.org/wiki/Pseudoprime
« Last Edit: 19/01/2023 21:00:37 by evan_au »
Logged
 

Offline alancalverd

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 21157
  • Activity:
    73.5%
  • Thanked: 60 times
  • Life is too short for instant coffee
Re: Why are code makers and code breakers obsessed with prime numbers?
« Reply #2 on: 19/01/2023 10:18:35 »
A very simple code consists of writing plain language into a grid of n x m squares, adding as much irrelevant padding as you wish, then transmitting it "perpendicularly" as m strings x n bytes. It's annoying to intercept because it has an entirely natural frequency table but utterly jumbled, and it's easy to decode if you know that the message is all contained in n x m bytes, which is unequivocal if n and m are prime, but if the string is immersed in padding and significantly longer than m x n it only makes sense if you know one of the primes.   
Logged
Helping stem the tide of ignorance
 



  • Print
Pages: [1]   Go Up
« previous next »
Tags: code makers  / code breakers  / rsa  / enigma 
 
There was an error while thanking
Thanking...
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    SMFAds for Free Forums
  • Naked Science Forum ©

Page created in 0.558 seconds with 30 queries.

  • Podcasts
  • Articles
  • Get Naked
  • About
  • Contact us
  • Advertise
  • Privacy Policy
  • Subscribe to newsletter
  • We love feedback

Follow us

cambridge_logo_footer.png

©The Naked Scientists® 2000–2017 | The Naked Scientists® and Naked Science® are registered trademarks created by Dr Chris Smith. Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.