久久久久久久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)益,請(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)
              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>
                          主站蜘蛛池模板: 在线看片你懂的 | 成人免费视频国产免费 | 国产午夜一区二区三区 | 一级毛片久久久 | 五月婷婷深深爱 | 少妇福利视频 | 四川一级毛毛片 | 一级片日韩| 午夜视频免费观看 | 国产日韩综合 | 免费理论片 | 日韩精品久久久久久久 | 国产午夜精品一区二区三区 | 超碰一区二区 | 日韩精品一区二区三区免费视频 | 久久久久人 | 欧美一级在线 | 成年视频在线观看 | 伊人久久影院 | 色噜噜狠狠一区二区三区果冻 | 99久久婷婷 | 免费性视频 | 精品在线免费视频 | 国产一级一片免费播放放a 男男成人高潮片免费网站 精品视频在线观看 | 欧美日韩高清在线 | 国产51自产区 | 97精品国产97久久久久久免费 | 国产精品一区三区 | 91片黄在线观看 | 午夜视频在线播放 | 少妇高潮久久久久久潘金莲 | 狠狠干影院 | 久久综合一区 | 二区在线观看 | 午夜精品久久久久久久久久久久 | 久久久久人 | 成年人黄色 | 伊人久久综合 | 国产无遮挡又黄又爽免费网站 | 日韩成人中文字幕 | 国产精品99久久久久久久久久久久 |