How to solve a problem involving modulus

  • Thread starter Thread starter hackish
  • Start date Start date
  • Tags Tags
    Modulus
hackish
Messages
2
Reaction score
0
Even though this deals with programming an encryption algorithm I feel this is more math based so I'm asking it here.

x=((y mod 380951)*3182) mod 380951

How can I solve for y?

A few helpful points:
1) the math involved here is limited to integers, so for example division by 3182 must result in an integer.
2) the number 380951 is a prime number.
3) the result must be smaller than 2^24
4) 3182-1 is also prime but I don't think this helps the solution.
5) x is an integer in the range of 0..2^16

I've read all the wiki pages on fermat's little theorem and the extended euclidean algorithm but the concepts they describe are beyond my math abilities.

I understand that there are multiple correct answers to this: EX:
y=291905 ;x=83172
or
y=1434758;x=83172

The first one will do and would be preferred since it has the greatest chance of fitting within the 24 bit result.

At present I've been exhaustively calculating it by trying every possible multiple of the prime number + the result / 3182 and it works so I know a solution is possible. Relating to the example above if you multiply 380951*2834+83172 gives 928841710 then divide by 3182 gives 291905.

Can anyone give steps to calculate the answer I need?
 
Physics news on Phys.org
Hey hackish and welcome to the forums.

You may want to try writing y as y = pq + r where p = 380951 and r is between 0 and 380950 inclusive.

Then do the same sort of thing for the outer modulus and bring the results together.
 
Ok, someone else solved it... thanks.
Turns out you can apply (3182^(380951-2)) mod 380951 then multiply that by x, then mod 380951 and you get y.

Wow. A little math wizardry and encrypting a file now takes 250ms instead of 23 minutes.
 
Last edited:
##\textbf{Exercise 10}:## I came across the following solution online: Questions: 1. When the author states in "that ring (not sure if he is referring to ##R## or ##R/\mathfrak{p}##, but I am guessing the later) ##x_n x_{n+1}=0## for all odd $n$ and ##x_{n+1}## is invertible, so that ##x_n=0##" 2. How does ##x_nx_{n+1}=0## implies that ##x_{n+1}## is invertible and ##x_n=0##. I mean if the quotient ring ##R/\mathfrak{p}## is an integral domain, and ##x_{n+1}## is invertible then...
The following are taken from the two sources, 1) from this online page and the book An Introduction to Module Theory by: Ibrahim Assem, Flavio U. Coelho. In the Abelian Categories chapter in the module theory text on page 157, right after presenting IV.2.21 Definition, the authors states "Image and coimage may or may not exist, but if they do, then they are unique up to isomorphism (because so are kernels and cokernels). Also in the reference url page above, the authors present two...
When decomposing a representation ##\rho## of a finite group ##G## into irreducible representations, we can find the number of times the representation contains a particular irrep ##\rho_0## through the character inner product $$ \langle \chi, \chi_0\rangle = \frac{1}{|G|} \sum_{g\in G} \chi(g) \chi_0(g)^*$$ where ##\chi## and ##\chi_0## are the characters of ##\rho## and ##\rho_0##, respectively. Since all group elements in the same conjugacy class have the same characters, this may be...
Back
Top