# With composite $n_1$ = $p_1q_1$, and a separate $n_2 = p_1q_2$, can the primes be calculated more efficiently than factorization?

Supposing that the (3 total) primes are kept secret? Does the reuse of $$p_1$$ allow an attacker to compromise $$n_1$$ and $$n_2$$ if the attacker guesses that both were generated with a shared prime between them (each having one unique prime)?

Yes, this trivially compromises them. Simply compute the gcd of $$n_1$$ and $$n_2$$, which will return $$p_1$$ (assuming $$q_1 \neq q_2$$). The gcd can be computed efficiently using Euclid's algorithm.