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

    <tfoot id='bqrxG'></tfoot>
  1. <small id='bqrxG'></small><noframes id='bqrxG'>

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

      .net 中的混合密碼系統實現.錯誤 指定的密鑰不是

      Hybrid cryptosystem implementation in .net. Error Specified key is not a valid size for this algorithm(.net 中的混合密碼系統實現.錯誤 指定的密鑰不是此算法的有效大小)

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

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

              1. 本文介紹了.net 中的混合密碼系統實現.錯誤 指定的密鑰不是此算法的有效大小的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在嘗試實現 https://en.wikipedia.org/wiki 中提到的混合密碼系統/Hybrid_cryptosystem

                目前我已經實現了以下算法

                At the moment I have implemented following algorithm

                private void button1_Click(object sender, EventArgs e)
                        {
                            CspParameters cspParams = new CspParameters { ProviderType = 1 };
                            RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider(1024, cspParams);
                            string publicKey = Convert.ToBase64String(rsaProvider.ExportCspBlob(false));
                            string privateKey = Convert.ToBase64String(rsaProvider.ExportCspBlob(true));
                            string symmericKey = "Kamran12";
                            txtEncryptedData.Text = EncryptData(txtInputData.Text, symmericKey);
                            string encryptedsymmetrickey = EncryptData(symmericKey, publicKey); //error line
                            //string decryptsymmetrickey = encryptedsymmetrickey + privateKey;
                
                            //string decrypteddata = encryptedData + decryptsymmetrickey;
                
                        }
                
                        public string EncryptData(string data, string key)
                        {
                            string encryptedData = null;
                
                            byte[] buffer = Encoding.UTF8.GetBytes(data);
                
                            DESCryptoServiceProvider desCryptSrvckey = new DESCryptoServiceProvider
                            {
                                Key = new UTF8Encoding().GetBytes(key)
                            };
                            desCryptSrvckey.IV = desCryptSrvckey.Key;
                
                            using (MemoryStream stmCipherText = new MemoryStream())
                            {
                                using (CryptoStream cs = new CryptoStream(stmCipherText, desCryptSrvckey.CreateEncryptor(), CryptoStreamMode.Write))
                                {
                                    cs.Write(buffer, 0, buffer.Length);
                                    cs.FlushFinalBlock();
                
                
                                    encryptedData = Encoding.UTF8.GetString(stmCipherText.ToArray());
                                }
                            }
                            return encryptedData;
                        }
                

                但收到錯誤指定的密鑰不是此算法的有效大小.在加密對稱密鑰時

                But getting error Specified key is not a valid size for this algorithm. at the time of encrypting the symmetric key

                推薦答案

                您正在嘗試使用帶有 RSA 公鑰的(不安全的)DES 算法進行加密.這總是會失敗,DESCryptoServiceProvider 不接受 RSA 密鑰.為此,您需要一個 RSACryptoServiceProvider.

                You are trying to encrypt using the (insecure) DES algorithm with an RSA public key. That's always going to fail, DESCryptoServiceProvider doesn't accept RSA keys. You'd need an RSACryptoServiceProvider for that.

                您可能需要考慮使用已經實現混合加密(PGP、CMS 或其中一種專有協議)的特定庫.您的解決方案最終可能會運行,但它是安全的.

                You may want to consider using a specific library that already implements hybrid cryptography (PGP, CMS or one of the proprietary protocols). The way you are going at it your solution may run in the end, but it will not be secure.

                這篇關于.net 中的混合密碼系統實現.錯誤 指定的密鑰不是此算法的有效大小的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                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)
              2. <tfoot id='pvd7O'></tfoot>
                    <tbody id='pvd7O'></tbody>

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

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

                        1. <legend id='pvd7O'><style id='pvd7O'><dir id='pvd7O'><q id='pvd7O'></q></dir></style></legend>
                          主站蜘蛛池模板: 成人在线精品视频 | 91久久精品国产91久久性色tv | 超碰人人人 | 天堂资源最新在线 | 激情网站在线观看 | 视频一区在线观看 | 黄色一级特级片 | 成人夜晚看av | 丁香五月网久久综合 | 日韩欧美一区二区三区在线播放 | 欧美日韩国产一区二区 | 国产精品一区二区视频 | 免费一区| 日韩在线免费播放 | 九九九国产 | 国产精品一码二码三码在线 | 在线视频国产一区 | 一区网站| 免费国产精品久久久久久 | 色综合久久88色综合天天 | 日韩一区二区三区在线视频 | 欧美精品在线播放 | 亚洲成人免费视频 | 国产伊人精品 | 精品久久中文 | 四虎永久在线精品免费一区二 | 国产有码 | 日韩有码在线播放 | 欧美v免费 | 日韩一区二区三区精品 | 久久久久久久久蜜桃 | 亚洲视频中文字幕 | 久久这里只有精品首页 | 亚洲一区二区三区桃乃木香奈 | 亚洲一区二区精品视频 | 免费视频99 | 热久久免费视频 | 国产欧美一区二区三区在线看蜜臀 | 欧美日韩国产一区二区三区 | 夜夜爆操 | 国产精品一区二区三区四区五区 |