# 数学代写|密码学代写cryptography theory代考|CS6260

## 数学代写|密码学代写cryptography theory代考|A General Plan for Factoring

The following theorem is ancient.
Theorem 3.6. If $n$ is a composite positive integer, $x$ and $y$ are integers, and $x^2 \equiv y^2(\bmod n)$, but $x \not \equiv \pm y(\bmod n)$, then $\operatorname{gcd}(x-y, n)$ and $\operatorname{gcd}(x+y, n)$ are proper factors of $n$.

Later we will tell how to find $x$ and $y$ with $x^2 \equiv y^2(\bmod n)$. However, it is difficult to ensure that $x \not \equiv \pm y(\bmod n)$, so we ignore this condition. The next theorem tells how several modern factoring algorithms finish.

Theorem 3.7. If $n$ is an odd positive integer having at least two different prime factors, and if integers $x$ and y are chosen randomly subject to $x^2 \equiv y^2(\bmod n)$, then, with probability $\geq 0.5, \operatorname{gcd}(x-y, n)$ is a proper factor of $n$.

One can compute in probabilistic polynomial time a square root of any quadratic residue $r$ modulo $n$, provided the factors of $n$ are known. In fact, computing square roots modulo $n$ is polynomial-time equivalent to factoring $n$.

Corollary. Let $n$ have at least two different odd prime factors. If there is a (probabilistic) polynomial time algorithm $\mathcal{A}$ to find a solution $x$ to $x^2 \equiv$ $r(\bmod n)$ for any quadratic residue $r$ modulo $n$, then there is a probabilistic polynomial time algorithm $\mathcal{B}$ to find a factor of $n$.

The general plan of several factoring algorithms is to generate (some) pairs of integers $x, y$ with $x^2 \equiv y^2(\bmod n)$, and hope that $\operatorname{gcd}(x-y, n)$ is a proper factor of $n$. Theorem $3.7$ says that we will not be disappointed often. It says that each such pair gives at least a 50 per cent chance to factor $n$. If $n$ has more than two (different) prime factors, then at least one of the greatest common divisor and its co-factor will be composite and we will have more factoring to do. In the fastest modern factoring algorithms it may take a long time to produce the first pair $x, y$, but after it is found many more random pairs are produced quickly, and these will likely yield all prime factors of $n$.

## 数学代写|密码学代写cryptography theory代考|The Continued Fraction Factoring Algorithm

The Continued Fraction Factoring Algorithm, CFRAC, of Morrison and Brillhart [444], uses the fact that the $Q_i$ are more likely to be smooth than numbers near $n / 2$ because they are small. The algorithm uses the continued fraction expansion for $\sqrt{n}$ to generate the sequences $\left{P_i\right},\left{Q_i\right},\left{q_i\right}$ and $\left{A_i \bmod n\right}$ via Eqs. (3.4), (3.5). (3.6) and (3.3), and tries to factor each $Q_i$ by trial division. Morrison and Brillhart restricted the primes in the trial division to those below some fixed bound $B$, called the factor base. CFRAC saves the $B$-smooth $Q_i$, together with the corresponding $A_{i-1}$, representing the relation $A_{i-1}^2 \equiv(-1)^i Q_i(\bmod n)$. When enough relations have been collected, Gaussian elimination is used to find linear dependencies (modulo 2 ) among the exponent vectors of the relations. We have enough relations when there are more of them than primes in the factor base. Each linear dependency produces a congruence $x^2 \equiv y^2(\bmod n)$ and a chance to factor $n$ by Theorem 3.7.

Assuming two plausible hypotheses, Pomerance [478] proved that the time complexity of CFRAC is $L(n)^{\sqrt{2}}$, where $L(x)=\exp (\sqrt{(\ln x) \ln \ln x})$.

Let me say more about the linear algebra step. Suppose there are $K$ primes in the factor base. Call them $p_1, p_2, \ldots, p_K$. (These are the primes $p \leq B$ for which $n$ is a quadratic residue modulo $p$. They comprise about half of the primes $\leq B$.) The goal is to find a set $S$ of $i$ for which the product $\prod_{i \in S}(-1)^i Q_i$ is the square of an integer. Since a square must be positive, the ‘prime’ $p_0=-1$ is added to the factor base. For each $i$ for which $(-1)^i Q_i$ is $B$ smooth, write $(-1)^i Q_i=\prod_{j=0}^K p_j^{e_{i j}}$. When $(-1)^i Q_i$ is $B$-smooth, define the vector $\mathbf{v}i=\left(e{i 0}, e_{i 1}, \ldots, e_{i K}\right)$. Note that when $(-1)^i Q_i$ and $(-1)^k Q_k$ are multiplied, the corresponding vectors $\mathbf{v}i, \mathbf{v}_j$ are added. A product such as $\prod{i \in S}(-1)^i Q_i$ is a square if and only if all entries in the vector sum $\sum_{i \in S} \mathbf{v}i$ are even numbers. Form a matrix with $K+1$ columns whose rows are the vectors $\mathbf{v}_i$ (reduced modulo 2) for which $(-1)^i Q_i$ is $B$-smooth. If there are more rows than columns in this matrix, Gaussian elimination will find non-trivial dependencies among the rows modulo 2. Let $S$ be the set of $i$ for which the row $\mathbf{v}_i$ is in the dependency. Each non-trivial dependency, say, $\sum{i \in S} \mathbf{v}i=\mathbf{0}$, gives a product $\prod{i \in S}(-1)^i Q_i$ which is a square, say, $y^2$. Let $x=\prod_{i \in S} A_{i-1} \bmod n$. Then $x^2 \equiv y^2(\bmod n)$, an instance of Theorem 3.7.

# 密码学代考

## 数学代写|密码学代写cryptography theory代考|The Continued Fraction Factoring Algorithm

Morrison 和 Brillhart [444] 的连分数因式分解算法 CFRAC 使用了以下事实: $Q_i$ 比附近的数字更可能平滑 Veft{A_i \bmod n\right? 通过方程式。(3.4)，(3.5)。(3.6) 和 (3.3)，并尝试对每个因嫊进行因式分解 $Q_i$ 由审 司。Morrison 和 Brillhart 将试验部分中的嗉数限制为低于某个固定界限的㨞数 $B$, 称为因子基。CFRAC 节省了 $B$-光滑的 $Q_i$ ，连同相应的 $A_{i-1}$ ，代表关系 $A_{i-1}^2 \equiv(-1)^i Q_i(\bmod n)$. 收集到足够多的关系后， 使用高斯消去法来查找关系的指数向量之间的线性相关性（模 2)。当它们的数量多于因子库中的嫊数 时，我们就有足够的关系。每个线性相关性都会产生一个一致性 $x^2 \equiv y^2(\bmod n)$ 和一个因傃的机会 $n$ 由定理 3.7。

$\prod_{i \in S}(-1)^i Q_i$ 是整数的平方。由于正方形必须为正，因此 嫊数” $p_0=-1$ 被添加到因子库中。对于每个 $i$ 为了哪个 $(-1)^i Q_i$ 是 $B$ 顺利，写 $(-1)^i Q_i=\prod_{j=0}^K p_j^{e_{i j}}$. 什么时候 $(-1)^i Q_i$ 是 $B$-smooth，定义向量 $\mathbf{v} i=\left(e i 0, e_{i 1}, \ldots, e_{i K}\right)$. 请注意，当 $(-1)^i Q_i$ 和 $(-1)^k Q_k$ 相乘，相应的向量v $v, \mathbf{v}j$ 被添加。一个产品 如 $\prod i \in S(-1)^i Q_i$ 是一个正方形当且仅当向量和中的所有条目 $\sum{i \in S} \mathbf{v} i$ 是偶数。形成一个矩阵 $K+1$ 行是向量的列 $\mathbf{v}i$ (减少模 2) 其中 $(-1)^i Q_i$ 是 $B$-光滑的。如果此矩阵中的行数多于列数，高斯消元法将在 行模 2 之间找到非平凡的依赖关系。令 $S$ 是一组 $i$ 对于哪一行 $\mathbf{v}_i$ 在依赖中。每个非平凡的依赖关系，比如 说， $\sum i \in S \mathbf{v} i=\mathbf{0}$, 给出一个产品 $\prod i \in S(-1)^i Q_i$ 这是一个正方形，比如说， $y^2$. 让 $x=\prod{i \in S} A_{i-1} \bmod n$. 然后 $x^2 \equiv y^2(\bmod n)$ ，定理 $3.7$ 的一个实例。

myassignments-help数学代考价格说明

1、客户需提供物理代考的网址，相关账户，以及课程名称，Textbook等相关资料~客服会根据作业数量和持续时间给您定价~使收费透明，让您清楚的知道您的钱花在什么地方。

2、数学代写一般每篇报价约为600—1000rmb，费用根据持续时间、周作业量、成绩要求有所浮动(持续时间越长约便宜、周作业量越多约贵、成绩要求越高越贵)，报价后价格觉得合适，可以先付一周的款，我们帮你试做，满意后再继续，遇到Fail全额退款。

3、myassignments-help公司所有MATH作业代写服务支持付半款，全款，周付款，周付款一方面方便大家查阅自己的分数，一方面也方便大家资金周转，注意:每周固定周一时先预付下周的定金，不付定金不予继续做。物理代写一次性付清打9.5折。

Math作业代写、数学代写常见问题

myassignments-help擅长领域包含但不是全部: