What Maths is Required for Writing a Quadratic or Number Sieve?

  • Thread starter Zurtex
  • Start date
In summary, the quadratic sieve is recommended for factoring numbers over the summer and requires knowledge of modular arithmetic, quadratic residues, and linear algebra. The number field sieve is more complex and requires a strong understanding of algebraic number theory. It is suggested to first try simpler factoring methods such as Pollard rho or the elliptic curve method before attempting the quadratic sieve. Programming knowledge and optimization techniques are also key for efficient implementation. It is recommended to consult expert Carl Pomerance for further assistance. The book "Cryptography and Number Theory" by Neal Koblitz is also recommended. The author may choose to use C++ for programming and consider using the AMD Athlon 64 X2 processor for faster processing.
  • #1
Zurtex
Science Advisor
Homework Helper
1,120
1
I was looking at writing a quadratic or a number sieve over the summer to factor numbers. What areas of maths do I need to know to be able to do this please?
 
Mathematics news on Phys.org
  • #2
The theory behind the quadratic sieve is BY FAR the easiest to understand -- a bright high schooler should be able to understand it.

The theory behind the number field sieve requires a good bit of algebraic number theory if you want to understand all of the details. (I.E. I don't! :biggrin:) The basic idea doesn't require much abstract algebra, the devil is in the details. However, you need to know even less to implement the sieve -- the messy stuff is needed for setting up the sieve, and for getting from the outputs to the factors.


The quadratic sieve is superior to the number field sieve except on extraordinarily large numbers.


Im summary, I strongly suggest doing the quadratic sieve. :smile:

By the way, you might want to write one of the lower powered factoring methods first: say, pollard rho, or the elliptic curve method if you know anything on the topic. They're superior to the quadratic sieve on smaller numbers, and may prove useful when optimizing your quadratic sieve, in case you need to factor something.


(I guess there's something called the "Square form method" or something like that, which is especially good at factoring things that fit into a single machine word -- I'm not sure if that is supposed to be a 32-bit word or a 64-bit word)
 
  • #3
Thanks, I'll get some books out on the subjects you've mentioned. I was looking at eventually factoring numbers with prime factors greater than 35 digits.
 
  • #4
Definitely much less background is needed for the quadratic sieve than the number field sieve. Nothing too fancy is needed, modular arithmetic and quadratic residues (in any elementary number theory text if you're not familiar), and a little linear algebra should suffice.
 
  • #5
i assume that you understand a lot of programming...if not you got to learn some.
parallel and memory manipulations would be some topics. There's an ebook i have but i can't remember the book name..its something liek "cryptography in C++"

I highly recommend the book by neal koblitz...it was recommended by a prof to me i browsed through it but haven't the $$ to pick it up.
its called "cryptography and number theory" or vice versa
 
  • #6
Well, yes. If you want to write a good quadratic sieve, you'll need two things:

(1) You'll have to implement fancy optimizations that are based on theory (such as the multiple polynomial QS, and the large and small prime variants)

(2) You'll have to understand some things about how your computer works, and how to optimize to take advantage of that. (and how not to be wasteful!)

For example, I factored a decent sized number (can't remember how big) in 20-something minutes with my first quadratic sieve. A friend of mine factored the same number in about two seconds with his sieve. :tongue:

I played around with a particular optimization on the sieving step (cache-blocking), and it was something like a factor of 6 speed up to do exactly the same operations, just done in a more efficient order.
 
Last edited:
  • #7
my friend carl pomerance is an expert on the quadratic sieve. why not ask him your question?

carlp@bell-labs.com
 
  • #8
Thanks for all your help. I don't know a lot about programming but I've always been very quick to learn any language I've ever come across. I also don't know a lot about the subject area, but this I've found to be the best way to learn for me, just to throw myself straight into a subject.

I've not yet decided which programming language I want to write it in. I've not touched C++ yet, so perhaps I'll go with that as we are supposed to learn it next semester anyway. Also thanks for the processor bit, I’m buying myself a new computer soon and I was looking at buying AMDs new dual core processor the Athlon 64 X2, so I'll see what whizzy things that can do.
 

What maths is required for physics?

The main maths skills required for physics include algebra, calculus, trigonometry, and geometry. These are used to solve problems involving motion, forces, energy, and more.

What maths is required for biology?

Biology requires a strong foundation in algebra, geometry, and statistics. These are used to analyze data, create and interpret graphs, and understand concepts such as population growth and genetics.

What maths is required for chemistry?

Chemistry relies heavily on algebra, geometry, and calculus. These are used to solve equations, calculate reaction rates, and understand concepts such as stoichiometry and thermodynamics.

What maths is required for computer science?

Computer science requires a strong foundation in algebra, calculus, and discrete mathematics. These are used to create algorithms, analyze data structures, and understand principles of logic and programming.

What maths is required for engineering?

Engineering involves a variety of maths skills, including algebra, calculus, trigonometry, and geometry. These are used to design and analyze structures, solve problems related to motion and forces, and understand concepts such as fluid mechanics and thermodynamics.

Similar threads

Replies
1
Views
945
Replies
8
Views
1K
  • General Math
Replies
4
Views
860
Replies
6
Views
945
Replies
8
Views
356
Replies
1
Views
1K
Replies
5
Views
1K
  • General Math
Replies
2
Views
1K
Replies
2
Views
961
Replies
14
Views
2K
Back
Top