Jump to content

Prime Numbers..

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
What is the deal with prime numbers in encryption? I see this a lot of time.. but what is the deal with them? Using prime numbers is more secure?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Prime powers of numbers have special properties that do not exist with composite powers. If you study Number Theory you can learn more about it, but it can get pretty deep pretty fast. Think of it as the equivalent of calculus on integers.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
monkey_instinct

monkey_instinct

    Learning Programmer

  • Members
  • PipPipPip
  • 88 posts
Checking if a number is hard is extremely hard for relatively big numbers. There's no formula for getting the nth prime number so, the reason of using prime number for encryption must be something related to that property.

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts

WingedPanther said:

If you study Number Theory you can learn more about it

Seems like Math to me.. Doesn't seem to be listed in my favorite subjects list.

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Here's a like that explains some of how it works: RSA - Wikipedia, the free encyclopedia
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Thanks, I'm sure I will not understand everything, but thanks for helping. I will read it as soon as I post this message.

EDIT:-

For example in here:
Posted Image

what are those three lines supposed to mean?

#7
Maurice_Z

Maurice_Z

    Learning Programmer

  • Members
  • PipPipPip
  • 41 posts
Table of mathematical symbols - Wikipedia, the free encyclopedia
This should be helpful.

#8
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Ow yeah! congruent, I knew that I already saw that symbol... but I couldn't remember what it was, I used this in Math...

#9
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
1. Choose two distinct large random prime numbers p and q

For this I'll use small primes: 23 and 29

2. Compute n = p q ( n is used as the modulus for both the public and private keys)

n = 23*29 = 667

3. Compute the totient: phi(n) = (p-1)(q-1)

phi(n) = 22 * 28 = 616

4. Choose an integer e, such that 1 < e < phi(n) and e and phi(n) share no factors other than 1 (i.e. e and phi(n) are coprime) (e is released as the public key exponent)

Prime factors of phi(n) are 2,2,2,7,11, so e could be 13*17 = 221

5. Compute d to satisfy the congruence relation d e equivalent to 1 mod phi(n); i.e. de = 1 + k phi(n) for some integer k. ( d is kept as the private key exponent)

After a little work, we get: d = (some value higher than 30) where (d*e) % 616 = 1
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog