Score:0

How to factor $n = p.q$, where $p,q$ are primes, knowing a multiple of $\mathrm{lcm}(p-1, q-1)$?

mm flag

I was reading this post https://senderek.com/SDLH/ about Shamir's hash function, which is defined as follows:

Let $p,q$ be positive prime integers and let $n=p\times q$. Let $\ell = \mathrm{lcm}(p-1, q-1)$. Find $g \in (\mathbb{Z}/n\mathbb{Z})^*$ such that $\ell$ is the smallest positive integer for which $g^\ell \equiv 1 \bmod n$, i.e., $\ell$ is the order of $g$ in $(\mathbb{Z}/n\mathbb{Z})^*$.

Set $H(m) = g^m \bmod n$ to be the hash function and discard $p$ and $q$.

Assuming that an adversary is able to find $m_1, m_2 \in \mathbb{Z}$ such that $m_1\neq m_2$ and $H(m_1) = H(m_2)$, this would mean that $g^{m_1} \equiv g^{m_2} \bmod n \implies g^{m_1-m_2}\equiv 1\bmod n$. From group theory, since $\ell$ is the order of $g$ in $(\mathbb{Z}/n\mathbb{Z})^*$, it follows that $m_1-m_2$ is multiple of $\ell$.

The post referenced earlier said that given a multiple of $\ell$, it is easy to factor $n$. However, I am struggling to figure out why it is the case.

My current intuition is that if we let $r$ be a multiple of $\ell$, one can recover $p-1$ and $q-1$ by enumerating all the divisors of $r$, and then by adding 1 to all those divisors, we can recover $p$ and $q$, and finally test which of those divisors are actually $p$ and $q$ by checking if they divide $n$. However, for large $p$ and $q$, this approach might still be tedious. Hence, is there a better way?

vxek avatar
mm flag
Do you mean how far away can $m_1$ be from $m_2$? i.e., how large can $m_1-m_2$ be?
dave_thompson_085 avatar
cn flag
https://groups.google.com/g/sci.crypt/c/wDV49EsAZQ0
yyyyyyy avatar
in flag
Does this answer your question? [Is knowing the private key of RSA equivalent to the factorization of $N$?](https://crypto.stackexchange.com/questions/16036/is-knowing-the-private-key-of-rsa-equivalent-to-the-factorization-of-n) Another short proof is given in Fact 1 of Boneh's [Twenty Years of Attacks on the RSA Cryptosystem](https://crypto.stanford.edu/~dabo/pubs/papers/RSA-survey.pdf).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.