久久久久久久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 中的混合密碼系統(tǒng)實(shí)現(xiàn).錯(cuò)誤 指定的密鑰不是

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

      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 中的混合密碼系統(tǒng)實(shí)現(xiàn).錯(cuò)誤 指定的密鑰不是此算法的有效大小的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

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

                我正在嘗試實(shí)現(xiàn) https://en.wikipedia.org/wiki 中提到的混合密碼系統(tǒng)/Hybrid_cryptosystem

                目前我已經(jīng)實(shí)現(xiàn)了以下算法

                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;
                        }
                

                但收到錯(cuò)誤指定的密鑰不是此算法的有效大小.在加密對(duì)稱密鑰時(shí)

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

                推薦答案

                您正在嘗試使用帶有 RSA 公鑰的(不安全的)DES 算法進(jìn)行加密.這總是會(huì)失敗,DESCryptoServiceProvider 不接受 RSA 密鑰.為此,您需要一個(gè) 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.

                您可能需要考慮使用已經(jīng)實(shí)現(xiàn)混合加密(PGP、CMS 或其中一種專有協(xié)議)的特定庫.您的解決方案最終可能會(huì)運(yùn)行,但它是安全的.

                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.

                這篇關(guān)于.net 中的混合密碼系統(tǒng)實(shí)現(xiàn).錯(cuò)誤 指定的密鑰不是此算法的有效大小的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                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)
              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>
                          主站蜘蛛池模板: 国产精品欧美一区二区三区 | 香蕉大人久久国产成人av | 成人免费视频播放 | 国产精品视频久久 | 99成人| 欧美大片一区 | 国产成人免费 | 一区二区三区四区不卡 | 成人在线观看中文字幕 | 中文字幕第九页 | 国产精品小视频在线观看 | 三级在线观看 | 狠狠色狠狠色综合日日92 | 成人在线视频看看 | 久久久国产一区二区三区 | www.久草 | 亚洲精品中文字幕 | 91九色婷婷 | 国产精品九九九 | 国产精品久久久久久吹潮日韩动画 | 国产欧美精品一区二区三区 | 中文字幕一区在线观看视频 | 亚洲精品欧美 | 中国一级特黄视频 | 久久久精品久久 | 97人人爱 | 欧美6一10sex性hd| 精品亚洲一区二区三区四区五区 | 亚洲网站在线播放 | 久久久久国产视频 | 成年人黄色免费视频 | 亚洲二区视频 | 久草视频在线播放 | 午夜网站视频 | 日韩成人 | 中文字幕久久精品 | 亚洲成人av | 高清久久久 | 日韩欧美在线视频 | 日本不卡一区二区三区 | 日本成年免费网站 |