I'm writing a cryptography essay, and am wondering why you need a prime number for the Diffie-Hellman key exchange? Any help would be appreciated :)
This is a link to a previous post which quickly shows what the Diffie-Hellman key exchange is: Why/How does the Diffie-Hellman Key Exchange work?
I haven't done modular arithmetic for a while, but I'm sure it will be a simple answer if someone is familiar with it/done it recently!
In fact you need two primes p and q
Then you can use arithmetic modulo pq to encrypt messages.
The one that knows the prime numbers can calculate things quickly mod pq
but because it is difficult to factor a number into primes, people who know the product and not the factors will not be able to calculate things so quickly mod pq.
That's how it is used for encryption.