61 - 80 of 99 Posts

i_ame_killer_2

·
Joined
·
5,315 Posts
Quote:
 Originally Posted by Manyak 8: RSA Encryption Find the most secure encryption RSA encryption is based on the following procedure: Generate two distinct primes p and q. Compute n=pq and φ=(p-1)(q-1). Find an integer e, 1
Question:
What is gcd? Greatest common divider?
and what is mod? Is it modulus (%)?

I dont get the bold part either, lol

Manyak

·
Joined
·
11,951 Posts
Discussion Starter · ·
Quote:
 Originally Posted by i_ame_killer_2 Question: What is gcd? Greatest common divider? and what is mod? Is it modulus (%)? I dont get the bold part either, lol
yes and yes

And the bold part are intervals:

[0, n-1]
is the same as
0 < x < n-1

i_ame_killer_2

·
Joined
·
5,315 Posts
Quote:
 Originally Posted by Manyak yes and yes And the bold part are intervals: [0, n-1] is the same as 0 < x < n-1
Looks like a quite interesting project. Thanks for the info

rabidgnome229

·
Joined
·
5,282 Posts
Quote:
 Originally Posted by Manyak yes and yes And the bold part are intervals: [0, n-1] is the same as 0 < x < n-1
Technically [0, n-1] is 0 <= x <= n-1. 0 < x < n-1 is (0, n-1). Not sure if that matters for the challenge

error10

·
Joined
·
13,477 Posts
So then don't you want [0,n-1) instead? Let's at least make sure we have the algorithm right.

·
Joined
·
5,315 Posts

Manyak

·
Joined
·
11,951 Posts
Discussion Starter · ·
Quote:
 Originally Posted by rabidgnome229 Technically [0, n-1] is 0 <= x <= n-1. 0 < x < n-1 is (0, n-1). Not sure if that matters for the challenge
oops.....yeah its <=, not <.

I guess I'm not a morning person no matter how hard I try

But yeah it would matter. Well, the algorithm would work fine until you had to encrypt the number 0 or n-1, then I guess depending on your code it would either skip it, lock up, or give you some other weird behavior.

im_not_an_artard

·
Registered
Joined
·
1,984 Posts
Quote:
 Originally Posted by BiG O I dealt with all those encryption shenanigans in a Discrete Mathematics class I took. I have no interest in dealing with them again haha. I'd like to see the code if someone does it though. Should be interesting.
oh god i hate discrete mathematics, final a week from tommorow ><

error10

·
Joined
·
13,477 Posts
Quote:
 Originally Posted by BiG O I dealt with all those encryption shenanigans in a Discrete Mathematics class I took. I have no interest in dealing with them again haha. I'd like to see the code if someone does it though. Should be interesting.
Me either. I just use OpenSSL and call it a day.

Manyak

·
Joined
·
11,951 Posts
Discussion Starter · ·
Quote:
 Originally Posted by im_not_an_artard any new challenges on the way?
yeah sorry...been a hectic week for me, I've been slacking on all my homework and projects this semester and now I'm cramming everything into the last week

metala

·
Registered
Joined
·
1,198 Posts
Quote:
 Originally Posted by error10 Me either. I just use OpenSSL and call it a day.
http://gmplib.org/32vs64.html

Quote:
 As you can see, GMP is much faster than OpenSSL. That's no news, and it's not the main point with these diagrams.
That's why I used GMP in my 2 RSA programs.

Quote:
 Originally Posted by BiG O I dealt with all those encryption shenanigans in a Discrete Mathematics class I took. I have no interest in dealing with them again haha. I'd like to see the code if someone does it though. Should be interesting.
I already did it. I think...
http://www.overclock.net/coding-prog...ml#post4939421
http://www.overclock.net/coding-prog...ml#post4964608

i_ame_killer_2

·
Joined
·
5,315 Posts
Guys, How do you calculate 545^503 in C++?

Manyak

·
Joined
·
11,951 Posts
Discussion Starter · ·
Quote:
 Originally Posted by i_ame_killer_2 Guys, How do you calculate 545^503 in C++?

Code:

Code:
``````#include <math.h>

pow(545, 503);``````

i_ame_killer_2

·
Joined
·
5,315 Posts
Quote:
 Originally Posted by Manyak Code: Code: ``````#include pow(545, 503);``````
....That wont work...

Manyak

·
Joined
·
11,951 Posts
Discussion Starter · ·
Then try

#include <cmath>

i_ame_killer_2

·
Joined
·
5,315 Posts
Quote:
 Originally Posted by Manyak Then try #include

The problem is that the number is to big.

And no, __int64 cant hold the value.

Manyak

·
Joined
·
11,951 Posts
Discussion Starter · ·
Oh, lol.

First try using unsigned __int64, and if that's still not big enough then use a 'bignum' compatible library, like this one.

metala

·
Registered
Joined
·
1,198 Posts
Quote:
 Originally Posted by i_ame_killer_2 The problem is that the number is to big. And no, __int64 cant hold the value.
Why would you need to hold such a value?

61 - 80 of 99 Posts