Skip to main content
edited tags
Link
CodesInChaos
  • 25.1k
  • 2
  • 90
  • 129

I'm having a hard time creating a functioning RSA algorithm for some reason even though I have all the steps right (or at least I think I do). So I have the following :

I picked prime numbers, p$p$ and q as $q$ as:

p = 13691$$p = 13691$$ q = 29387$$q = 29387$$

I picked n$n$ as p*q$p \cdot q$ n 402337417$$n = 402337417$$

So phi(n) 402294340$$\phi(n) = 402294340$$

I picked a random e$e$ between 1$1$ and phi(n)$\phi(n)$ e 46117$e = 46117$

My message was M=3$M=3$

I got d$d$ by the Extended Euclidean Algorithm as the following: d= 7795$d= 7795$

When I do the encryption using M^e mod n$M^e \,\text{mod}\, n$ I get: c= 399797630$c= 399797630$

When I do the decryption using C^d mod n $C^d \,\text{mod}\, n$, I get 243069037$243069037$, which is not M = 3$M = 3$?

Any idea what can be the reason behind this? myMy guess is that d$d$ is incorrect.

I'm having a hard time creating a functioning RSA algorithm for some reason even though I have all the steps right (or at least I think I do). So I have the following :

I picked prime numbers, p and q as :

p = 13691 q = 29387

I picked n as p*q n 402337417

So phi(n) 402294340

I picked a random e between 1 and phi(n) e 46117

My message was M=3

I got d by the Extended Euclidean Algorithm as the following: d= 7795

When I do the encryption using M^e mod n I get: c= 399797630

When I do the decryption using C^d mod n , I get 243069037, which is not M = 3?

Any idea what can be the reason behind this? my guess that d is incorrect

I'm having a hard time creating a functioning RSA algorithm for some reason even though I have all the steps right (or at least I think I do). So I have the following :

I picked prime numbers, $p$ and $q$ as:

$$p = 13691$$ $$q = 29387$$

I picked $n$ as $p \cdot q$ $$n = 402337417$$

So $$\phi(n) = 402294340$$

I picked a random $e$ between $1$ and $\phi(n)$ $e = 46117$

My message was $M=3$

I got $d$ by the Extended Euclidean Algorithm as the following: $d= 7795$

When I do the encryption using $M^e \,\text{mod}\, n$ I get: $c= 399797630$

When I do the decryption using $C^d \,\text{mod}\, n$, I get $243069037$, which is not $M = 3$?

Any idea what can be the reason behind this? My guess is that $d$ is incorrect.

edited tags
Source Link

RSA encryption adnand decryption not resulting to the correct result?

I'm having a hard time creating a functioning RSA algorithm for some reason even though I have all the steps right (or at least I think I do). So I have the following :

I picked prime numbers, p and q as :

p = 13691 q = 29387

I picked n as p*q n 402337417

So phi(n) 402294340

I picked a random e between 1 and phi(n) e 46117

My message was M=3

I got d by the Extended Euclidean Algorithm as the following: d= 7795

When I do the encryption using M^e mod n I get: c= 399797630

When I do the decryption using C^d mod n , I get 243069037, which is not M = 3?

Any idea what can be the reason behind this? my guess that d is incorrect

RSA encryption adn decryption

I'm having a hard time creating a functioning RSA algorithm for some reason even though I have all the steps right (or at least I think I do). So I have the following :

I picked prime numbers, p and q as :

p = 13691 q = 29387

I picked n as p*q n 402337417

So phi(n) 402294340

I picked a random e between 1 and phi(n) e 46117

My message was M=3

I got d by the Extended Euclidean Algorithm as the following: d= 7795

When I do the encryption using M^e mod n I get: c= 399797630

When I do the decryption using C^d mod n , I get 243069037, which is not M = 3?

Any idea what can be the reason behind this?

RSA encryption and decryption not resulting to the correct result?

I'm having a hard time creating a functioning RSA algorithm for some reason even though I have all the steps right (or at least I think I do). So I have the following :

I picked prime numbers, p and q as :

p = 13691 q = 29387

I picked n as p*q n 402337417

So phi(n) 402294340

I picked a random e between 1 and phi(n) e 46117

My message was M=3

I got d by the Extended Euclidean Algorithm as the following: d= 7795

When I do the encryption using M^e mod n I get: c= 399797630

When I do the decryption using C^d mod n , I get 243069037, which is not M = 3?

Any idea what can be the reason behind this? my guess that d is incorrect

Post Migrated Here from security.stackexchange.com (revisions)
Source Link
Loading