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
  • Member Map
  • 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
  • 617 Views
  • 4 Tags

0 Members and 1 Guest are viewing this topic.

Offline Pseudoscience-is-malarkey (OP)

  • Hero Member
  • *****
  • 753
  • Activity:
    11%
  • Thanked: 25 times
    • View Profile
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!
  • ********
  • 10748
  • Activity:
    20%
  • Thanked: 1383 times
    • View Profile
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!
  • ********
  • 16291
  • Activity:
    73.5%
  • Thanked: 1302 times
  • life is too short to drink instant coffee
    • View Profile
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 to stem the tide of ignorance
 



  • Print
Pages: [1]   Go Up
« previous next »
Tags: code makers  / code breakers  / rsa  / enigma 
 

Similar topics (5)

Is the lack of pattern in irrational numbers a pattern in itself?

Started by Felix NielsenBoard General Science

Replies: 4
Views: 6961
Last post 26/07/2008 22:49:15
by lightarrow
Does choosing numbers in a lottery entry affect the outcome of that lottery?

Started by David ReichardBoard Physics, Astronomy & Cosmology

Replies: 10
Views: 4032
Last post 22/11/2016 09:53:40
by alancalverd
Why is there a sudden surge in Daddy Long Legs (Crane Fly) numbers?

Started by neilepBoard Plant Sciences, Zoology & Evolution

Replies: 43
Views: 44881
Last post 06/04/2019 18:04:49
by James Farr
Open Office Word Processor And Page Numbers...

Started by TitanscapeBoard Geek Speak

Replies: 2
Views: 6489
Last post 07/04/2009 21:20:09
by LeeE
Why do alkanes with even numbers of carbon atoms pack more closely?

Started by EvilFrogBoard Chemistry

Replies: 5
Views: 12790
Last post 11/09/2009 15:04:23
by EvilFrog
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.179 seconds with 37 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.