久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='rq2wK'></bdo><ul id='rq2wK'></ul>

    1. <i id='rq2wK'><tr id='rq2wK'><dt id='rq2wK'><q id='rq2wK'><span id='rq2wK'><b id='rq2wK'><form id='rq2wK'><ins id='rq2wK'></ins><ul id='rq2wK'></ul><sub id='rq2wK'></sub></form><legend id='rq2wK'></legend><bdo id='rq2wK'><pre id='rq2wK'><center id='rq2wK'></center></pre></bdo></b><th id='rq2wK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rq2wK'><tfoot id='rq2wK'></tfoot><dl id='rq2wK'><fieldset id='rq2wK'></fieldset></dl></div>

      <small id='rq2wK'></small><noframes id='rq2wK'>

    2. <tfoot id='rq2wK'></tfoot>

      1. <legend id='rq2wK'><style id='rq2wK'><dir id='rq2wK'><q id='rq2wK'></q></dir></style></legend>

        根據(jù)私有指數(shù) (d)、公共指數(shù) (e) 和模數(shù) (n) 計(jì)算素

        Calculate primes p and q from private exponent (d), public exponent (e) and the modulus (n)(根據(jù)私有指數(shù) (d)、公共指數(shù) (e) 和模數(shù) (n) 計(jì)算素?cái)?shù) p 和 q)
        <i id='nNXm4'><tr id='nNXm4'><dt id='nNXm4'><q id='nNXm4'><span id='nNXm4'><b id='nNXm4'><form id='nNXm4'><ins id='nNXm4'></ins><ul id='nNXm4'></ul><sub id='nNXm4'></sub></form><legend id='nNXm4'></legend><bdo id='nNXm4'><pre id='nNXm4'><center id='nNXm4'></center></pre></bdo></b><th id='nNXm4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nNXm4'><tfoot id='nNXm4'></tfoot><dl id='nNXm4'><fieldset id='nNXm4'></fieldset></dl></div>

        <legend id='nNXm4'><style id='nNXm4'><dir id='nNXm4'><q id='nNXm4'></q></dir></style></legend>
          <tbody id='nNXm4'></tbody>
          <tfoot id='nNXm4'></tfoot>
            <bdo id='nNXm4'></bdo><ul id='nNXm4'></ul>

                1. <small id='nNXm4'></small><noframes id='nNXm4'>

                  本文介紹了根據(jù)私有指數(shù) (d)、公共指數(shù) (e) 和模數(shù) (n) 計(jì)算素?cái)?shù) p 和 q的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  如何根據(jù) e(公鑰)、d(私鑰)和模數(shù)計(jì)算 p 和 q 參數(shù)?

                  How do I calculate the p and q parameters from e (publickey), d (privatekey) and modulus?

                  我手頭有 BigInteger 鍵,我可以將粘貼復(fù)制到代碼中.一個(gè)公鑰,一個(gè)私鑰和一個(gè)模數(shù).

                  I have BigInteger keys at hand I can copy paste into code. One publickey, one privatekey and a modulus.

                  我需要從中計(jì)算 RSA 參數(shù) p 和 q.但我懷疑有一個(gè)我無法用谷歌找到的圖書館.有任何想法嗎?謝謝.

                  I need to calculate the RSA parameters p and q from this. But I suspect there is a library for that which I was unable to find with google. Any ideas? Thanks.

                  這不一定是蠻力,因?yàn)槲也皇窃趯ふ宜借€.我只有一個(gè)遺留系統(tǒng),它存儲(chǔ)了一個(gè)公鑰、私鑰對(duì)和一個(gè)模數(shù),我需要將它們放入 c# 以與 RSACryptoServiceProvider 一起使用.

                  This does not have to be brute force, since I'm not after the private key. I just have a legacy system which stores a public, private key pair and a modulus and I need to get them into c# to use with RSACryptoServiceProvider.

                  所以歸結(jié)為計(jì)算 (p+q)

                  So it comes down to calculating (p+q) by

                  public BigInteger _pPlusq()
                      {
                          int k = (this.getExponent() * this.getD() / this.getModulus()).IntValue();
                  
                          BigInteger phiN = (this.getExponent() * this.getD() - 1) / k;
                  
                          return phiN - this.getModulus() - 1;
                  
                      }
                  

                  但這似乎不起作用.你能發(fā)現(xiàn)問題嗎?

                  but this doesn't seem to work. Can you spot the problem?

                  5 小時(shí)后... :)

                  5 hours later... :)

                  好的.如何從 Zn* (http://en.wikipedia.org/wiki/C# 中的 Multiplicative_group_of_integers_modulo_n)?

                  Ok. How can I select a random number out of Zn* (http://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n) in C#?

                  推薦答案

                  假設(shè) e 很小(這是常見的情況;傳統(tǒng)的公共指數(shù)是 65537).我們還假設(shè) ed = 1 mod phi(n),其中 phi(n) = (p-1)(q-1)(不一定是這種情況;RSA 要求是 ed = 1 mod lcm(p-1,q-1)phi(n) 只是 lcm(p-1,q-1)) 的倍數(shù).

                  Let's assume that e is small (that's the common case; the Traditional public exponent is 65537). Let's also suppose that ed = 1 mod phi(n), where phi(n) = (p-1)(q-1) (this is not necessarily the case; the RSA requirements are that ed = 1 mod lcm(p-1,q-1) and phi(n) is only a multiple of lcm(p-1,q-1)).

                  現(xiàn)在你有 ed = k*phi(n)+1 用于某個(gè)整數(shù) k.因?yàn)?d 小于 phi(n),所以你知道 k <e.所以你只有少量的 k 可以嘗試.實(shí)際上,phi(n)n 很接近(差別在 sqrt(n) 的量級(jí)上;換句話說,當(dāng)寫成phi(n) 的上半部分與 n) 的上半部分相同,因此您可以使用以下公式計(jì)算 k':k'=round(ed/n).k'k 非常接近(即 |k'-k| <= 1),只要 的大小e 不超過 n 大小的一半.

                  Now you have ed = k*phi(n)+1 for some integer k. Since d is smaller than phi(n), you know that k < e. So you only have a small number of k to try. Actually, phi(n) is close to n (the difference being on the order of sqrt(n); in other words, when written out in bits, the upper half of phi(n) is identical to that of n) so you can compute k' with: k'=round(ed/n). k' is very close to k (i.e. |k'-k| <= 1) as long as the size of e is no more than half the size of n.

                  給定 k,你很容易得到 phi(n) = (ed-1)/k.碰巧的是:

                  Given k, you easily get phi(n) = (ed-1)/k. It so happens that:

                  phi(n) = (p-1)(q-1) = pq - (p+q) + 1 = n + 1 - (p+q)

                  因此,您得到 p+q = n + 1 - phi(n).你也有pq.是時(shí)候記住對(duì)于所有實(shí)數(shù) abab 是二次方程X2-(a+b)X+ab.所以,給定p+qpq,通過解二次方程得到pq:

                  Thus, you get p+q = n + 1 - phi(n). You also have pq. It is time to remember that for all real numbers a and b, a and b are the two solutions of the quadratic equation X2-(a+b)X+ab. So, given p+q and pq, p and q are obtained by solving the quadratic equation:

                  p = ((p+q) + sqrt((p+q)2 - 4*pq))/2

                  p = ((p+q) + sqrt((p+q)2 - 4*pq))/2

                  q = ((p+q) - sqrt((p+q)2 - 4*pq))/2

                  q = ((p+q) - sqrt((p+q)2 - 4*pq))/2

                  在一般情況下,ed 可能具有任意大小(可能大于 n),因?yàn)?RSA 所需要的只是ed = 1 mod (p-1)ed = 1 mod (q-1).有一種通用(且快速)的方法,看起來有點(diǎn)像 Miller-Rabin 素?cái)?shù)測(cè)試.Handbook of Applied Cryptography(第 8 章,第 8.2.2 節(jié),第 287 頁).該方法在概念上有點(diǎn)復(fù)雜(它涉及模冪運(yùn)算),但實(shí)現(xiàn)起來可能更簡(jiǎn)單(因?yàn)闆]有平方根).

                  In the general case, e and d may have arbitrary sizes (possibly greater than n), because all that RSA needs is that ed = 1 mod (p-1) and ed = 1 mod (q-1). There is a generic (and fast) method which looks a bit like the Miller-Rabin primality test. It is described in the Handbook of Applied Cryptography (chapter 8, section 8.2.2, page 287). That method is conceptually a bit more complex (it involves modular exponentiation) but may be simpler to implement (because there is no square root).

                  這篇關(guān)于根據(jù)私有指數(shù) (d)、公共指數(shù) (e) 和模數(shù) (n) 計(jì)算素?cái)?shù) p 和 q的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測(cè)有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運(yùn)行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時(shí)刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時(shí)突出顯示行)
                  Calling A Button OnClick from a function(從函數(shù)調(diào)用按鈕 OnClick)

                    1. <tfoot id='kBwqe'></tfoot>

                      <small id='kBwqe'></small><noframes id='kBwqe'>

                      <i id='kBwqe'><tr id='kBwqe'><dt id='kBwqe'><q id='kBwqe'><span id='kBwqe'><b id='kBwqe'><form id='kBwqe'><ins id='kBwqe'></ins><ul id='kBwqe'></ul><sub id='kBwqe'></sub></form><legend id='kBwqe'></legend><bdo id='kBwqe'><pre id='kBwqe'><center id='kBwqe'></center></pre></bdo></b><th id='kBwqe'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kBwqe'><tfoot id='kBwqe'></tfoot><dl id='kBwqe'><fieldset id='kBwqe'></fieldset></dl></div>
                      <legend id='kBwqe'><style id='kBwqe'><dir id='kBwqe'><q id='kBwqe'></q></dir></style></legend>

                          <bdo id='kBwqe'></bdo><ul id='kBwqe'></ul>
                              <tbody id='kBwqe'></tbody>
                            主站蜘蛛池模板: 一级视频在线免费观看 | 精品久久久久久久久久 | 日韩1区 | av一二三四 | 久久精品中文字幕 | 亚洲国产免费 | 超碰网址 | 国产日韩精品视频 | 精品综合 | 久久久久久久久综合 | 久草青青| 久久这里只有精品首页 | 九九热精 | 久久高清亚洲 | 国产精品亚洲综合 | 99国产精品99久久久久久 | 免费高清av | 亚洲中午字幕 | 欧美一区2区三区3区公司 | 九一在线观看 | 国产在线资源 | 人人爽人人草 | 精品在线99 | 国产亚洲成av人片在线观看桃 | 九九精品视频在线 | www.788.com色淫免费| 看片国产 | 日本aa毛片a级毛片免费观看 | 天天爽天天操 | 91在线色视频| 色姑娘综合网 | 国产福利在线播放 | 久久久久久免费毛片精品 | 久久国产精品99久久久久久丝袜 | 在线日韩 | 一区二区三区国产精品 | 久久久久免费观看 | 日本福利片 | 在线视频国产一区 | 国产精品成人一区二区三区 | 激情一区二区三区 |