Overclock.net banner
61 - 80 of 99 Posts

·
Premium Member
Joined
·
5,315 Posts
Quote:


Originally Posted by Manyak
View Post

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<e<φ, such that gcd(e,φ)=1.

A message in this system is a number in the interval [0,n-1].
A text to be encrypted is then somehow converted to messages (numbers in the interval [0,n-1]).

To encrypt the text, for each message, m, c=m^e mod n is calculated.

Question:
What is gcd? Greatest common divider?
and what is mod? Is it modulus (%)?

I dont get the bold part either, lol
 

·
Premium Member
Joined
·
11,951 Posts
Discussion Starter · #62 ·
Quote:


Originally Posted by i_ame_killer_2
View Post

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
 

·
Premium Member
Joined
·
5,315 Posts
Quote:

Originally Posted by Manyak View Post
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
 

·
Premium Member
Joined
·
5,282 Posts
Quote:

Originally Posted by Manyak View Post
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
 

·
Premium Member
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.
 

·
Premium Member
Joined
·
11,951 Posts
Discussion Starter · #67 ·
Quote:

Originally Posted by rabidgnome229 View Post
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.
 

·
Premium Member
Joined
·
4,343 Posts
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.
 

·
Registered
Joined
·
1,984 Posts
Quote:

Originally Posted by BiG O View Post
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 ><
 

·
Premium Member
Joined
·
13,477 Posts
Quote:


Originally Posted by BiG O
View Post

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.
 

·
Premium Member
Joined
·
11,951 Posts
Discussion Starter · #72 ·
Quote:


Originally Posted by im_not_an_artard
View Post

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
 

·
Registered
Joined
·
1,198 Posts
Quote:


Originally Posted by error10
View Post

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
View Post

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
 

·
Premium Member
Joined
·
11,951 Posts
Discussion Starter · #75 ·
Quote:

Originally Posted by i_ame_killer_2 View Post
Guys, How do you calculate 545^503 in C++?

Code:

Code:
#include <math.h>

pow(545, 503);
 

·
Premium Member
Joined
·
11,951 Posts
Discussion Starter · #79 ·
Oh, lol.

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

·
Registered
Joined
·
1,198 Posts
Quote:


Originally Posted by i_ame_killer_2
View Post



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
Top