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

<legend id='Tc9zc'><style id='Tc9zc'><dir id='Tc9zc'><q id='Tc9zc'></q></dir></style></legend>

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

    <tfoot id='Tc9zc'></tfoot>

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

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

        RSACryptoServiceProvider 用自己的公鑰和私鑰初始化

        RSACryptoServiceProvider initialize with own public key and private key(RSACryptoServiceProvider 用自己的公鑰和私鑰初始化)
              <legend id='rOjcu'><style id='rOjcu'><dir id='rOjcu'><q id='rOjcu'></q></dir></style></legend>

                  <tbody id='rOjcu'></tbody>

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

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

                  本文介紹了RSACryptoServiceProvider 用自己的公鑰和私鑰初始化的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在嘗試使用我自己的公鑰和私鑰初始化 RSACryptoServiceProvider.

                  I'm trying to initialize RSACryptoServiceProvider with my own public and private keys.

                  據我所知,這樣做的方法是使用

                  As far as I could research, the way to do this is to call the constructor with

                  RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider(cspParams);
                  

                  cspParams 如上所示.但是,當我查看有關使用它的 msdn 示例時:http://msdn.microsoft.com/en-us/library/ca5htw4f.aspx

                  cspParams as shown above. However, when I look at the msdn example on the use of it: http://msdn.microsoft.com/en-us/library/ca5htw4f.aspx

                  我沒有看到他們設置私鑰或公鑰的任何地方.僅使用 KeyContainer.當我創建一個沒有 cspParam 的 RSACryptoServiceProvider 時,它默認設置為僅使用公鑰.當我檢查類本身的 PublicOnly 變量時,我注意到了這一點,它是一個只讀變量.

                  I don't see any place where they set the private or public keys. Only using a KeyContainer. When I create an RSACryptoServiceProvider without a cspParam, then it is by default set to only use a Public key. I notice this when I check the PublicOnly variable on the class itself and it is a read only variable.

                  我的問題是如何初始化這個類,然后設置我自己的私鑰和公鑰.服務器將使用私鑰,客戶端將擁有公鑰.

                  我發現創建一個 RSAParameter 對象并將其上的 .Exponent 和 .Modulus 參數分別設置為公共和私有變量.

                  What I found out is that creating an RSAParameter object and setting the .Exponent and .Modulus parameters on it as the public and private variables respectively.

                  但我收到 "Missing Private Key" 錯誤,因為我認為 RSACryptoServiceProvider 未使用正確的構造函數進行初始化.

                  But I'm getting a "Missing Private Key" error since I believe the RSACryptoServiceProvider isn't initialized with the correct constructor.

                  以下是我的一些代碼.不用擔心 BigInteger 類,這只是一個實驗.不管我是否使用它,我都會得到同樣的錯誤.

                  Below is some of my code. Don't worry about BigInteger class, it's just an experiment. Even if I use it or not, I get the same error.

                  //Create a UnicodeEncoder to convert between byte array and string.
                  UnicodeEncoding ByteConverter = new UnicodeEncoding();
                  
                  byte[] dataToEncrypt = ByteConverter.GetBytes(password);
                  byte[] encryptedData;
                  byte[] decryptedData;
                  
                  //RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
                  RSAParameters rsap = new RSAParameters();
                  
                  BigInteger n = new BigInteger("19579160939939334264971282204525611731944172893619019759209712156289528980860378672033164235760825723282900348193871051950190013953658941960463089031452404364269503721476236241284015792700835264262839734314564696723261501877759107784604657504350348081273959965406686529089170062268136253938904906635532824296510859016002105655690559115059267476786307037941751235763572931501055146976797606538425089134251611194500570922973015579287289778637105402129208324300035518642730384616767241853993887666288072512402523498267733725021939287517009966986976768028023180137546958580922532786773172365428677544232641888174470601681", 10);
                  
                  BigInteger e = new BigInteger("65537", 10);
                  
                  //rsap.Modulus = ByteConverter.GetBytes(publicKey);
                  rsap.Exponent = e.getBytes();
                  rsap.Modulus = n.getBytes();
                    /*rsap.Exponent = ByteConverter.GetBytes(publicKey);
                      rsap.D = ByteConverter.GetBytes(publicKey);
                      rsap.DP = ByteConverter.GetBytes(publicKey);
                      rsap.DQ = ByteConverter.GetBytes(publicKey);
                      rsap.P = ByteConverter.GetBytes(publicKey);
                      rsap.Q = ByteConverter.GetBytes(publicKey);
                      rsap.InverseQ = ByteConverter.GetBytes(publicKey);*/
                  
                  using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
                  {
                      //RSA.PublicOnly = false;
                  
                      RSA.ImportParameters(rsap);
                  
                      Debug.Log ("PublicOnly: " + RSA.PublicOnly);
                  
                      Debug.Log (rsap.Modulus.Length);
                      //Debug.Log (RSA.ToString());
                          //Pass the data to ENCRYPT, the public key information  
                          //(using RSACryptoServiceProvider.ExportParameters(false), 
                          //and a boolean flag specifying no OAEP padding.
                          //encryptedData = RSACSPSample.RSAEncrypt(dataToEncrypt, rsap, false);
                          encryptedData = RSACSPSample.RSAEncrypt(dataToEncrypt, RSA.ExportParameters(false), false);
                  
                  
                          Debug.Log ("encryptedData: " + encryptedData);
                          //Display the decrypted plaintext to the console. 
                          //Debug.Log("Decrypted plaintext: " + ByteConverter.GetString(""));
                  
                          //Pass the data to DECRYPT, the private key information  
                          //(using RSACryptoServiceProvider.ExportParameters(true), 
                          //and a boolean flag specifying no OAEP padding.
                          decryptedData = RSACSPSample.RSADecrypt(encryptedData, RSA.ExportParameters(true), false);
                  }
                  
                  
                  //encryptedData = RSACSPSample.RSAEncrypt(dataToEncrypt, rsap, false);
                  
                  //if (encryptedData != null) {
                      password = ByteConverter.GetString(decryptedData);
                  /
                                  
                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

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

                • <small id='5gHfg'></small><noframes id='5gHfg'>

                  <legend id='5gHfg'><style id='5gHfg'><dir id='5gHfg'><q id='5gHfg'></q></dir></style></legend>
                  <tfoot id='5gHfg'></tfoot>

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

                            <bdo id='5gHfg'></bdo><ul id='5gHfg'></ul>
                          • 主站蜘蛛池模板: 夜夜精品浪潮av一区二区三区 | 午夜精品一区二区三区在线观看 | 久久国产精品视频 | 亚洲精品一区二区三区蜜桃久 | 精品久久久久久中文字幕 | 国产成人精品免费视频大全最热 | 精品一区二区三区在线观看 | 国产999精品久久久影片官网 | 99热这里| 久久精品二区亚洲w码 | 91.色| 色爱综合网 | 一区在线播放 | 九色 在线 | 欧美精品一二区 | 久久青草av | 在线视频中文字幕 | 国产精品成人久久久久 | 欧美成人激情视频 | 久久精品国产久精国产 | 欧美精品一区二区三区一线天视频 | 天天操网 | 日韩成人av在线 | 鸳鸯谱在线观看高清 | 人人干人人艹 | 国产精品一区三区 | 成人h动漫精品一区二区器材 | 精品久久久久久红码专区 | 97精品超碰一区二区三区 | 麻豆91av| 国产精品久久久久久久久久久久久久 | 国产分类视频 | 日韩精品一区二 | 羞羞在线视频 | 国产精品久久久久久久久久不蜜臀 | 日韩一区二区三区精品 | 国产精品美女久久久久久免费 | 日本黄色大片免费 | 青青草原精品99久久精品66 | 午夜精品久久久久久久久久久久久 | 国产97在线看 |