当前位置: 首页 > news >正文

网站换空间 seo如何联系百度客服

网站换空间 seo,如何联系百度客服,网站建设合同,站长工具国产C# 实现 国密SM4/ECB/PKCS7Padding对称加密解密,为了演示方便本问使用的是Visual Studio 2022 来构建代码的 1、新建项目,之后选择 项目 鼠标右键选择 管理NuGet程序包管理,输入 BouncyCastle 回车 添加BouncyCastle程序包 2、代码如下&am…

C# 实现 国密SM4/ECB/PKCS7Padding对称加密解密,为了演示方便本问使用的是Visual Studio 2022 来构建代码的

1、新建项目,之后选择 项目 鼠标右键选择  管理NuGet程序包管理,输入  BouncyCastle 回车 添加BouncyCastle程序包

2、代码如下:CBC模式

                        byte[] plaintext = Encoding.UTF8.GetBytes("1234567890国abcdefghijklmnopqrstuvwxyz");byte[] keyBytes = Encoding.UTF8.GetBytes("1234567890123456");byte[] iv = Encoding.UTF8.GetBytes("0123456789ABCDEF");// SM4/CBC加密KeyParameter key = ParameterUtilities.CreateKeyParameter("SM4", keyBytes);ParametersWithIV keyParamWithIv = new ParametersWithIV(key, iv);IBufferedCipher inCipher = CipherUtilities.GetCipher("SM4/CBC/PKCS7Padding");inCipher.Init(true, keyParamWithIv);byte[] cipher = inCipher.DoFinal(plaintext);//Console.WriteLine("加密后的密文(hex): {0}", BitConverter.ToString(cipher, 0).Replace("-", string.Empty));rtbCard.Text = $"加密后的密文: {Convert.ToBase64String(cipher).Replace("-", string.Empty)}";// SM4/CBC解密inCipher.Reset();inCipher.Init(false, key);byte[] bin = inCipher.DoFinal(cipher);string ans = Encoding.UTF8.GetString(bin);//Console.WriteLine("解密后的密文(hex): {0}", Convert.ToBase64String(cipher).Replace("-", string.Empty));//Console.WriteLine("解密明文内容:  {0}\t是否匹配: {1}", ans, Enumerable.SequenceEqual(plaintext, bin));rtbCard.Text = rtbCard.Text + "\r\n" + $"解密明文内容:  {ans}\t是否匹配: {Enumerable.SequenceEqual(plaintext, bin)}";

代码如下:ECB模式

 byte[] plaintext = Encoding.UTF8.GetBytes("1234567890国abcdefghijklmnopqrstuvwxyz");byte[] keyBytes = Encoding.UTF8.GetBytes("1234567890123456");byte[] iv = Encoding.UTF8.GetBytes("0123456789ABCDEF");// SM4/ECB加密KeyParameter key = ParameterUtilities.CreateKeyParameter("SM4", keyBytes);//ParametersWithIV keyParamWithIv = new ParametersWithIV(key, iv);ParametersWithIV keyParamWithIv = new ParametersWithIV(key, iv);//IBufferedCipher inCipher = CipherUtilities.GetCipher("SM4/CBC/PKCS7Padding");IBufferedCipher inCipher = CipherUtilities.GetCipher("SM4/ECB/PKCS7Padding");//inCipher.Init(true, keyParamWithIv);inCipher.Init(true, key);byte[] cipher = inCipher.DoFinal(plaintext);//Console.WriteLine("加密后的密文(hex): {0}", BitConverter.ToString(cipher, 0).Replace("-", string.Empty));rtbCard.Text = $"加密后的密文: {Convert.ToBase64String(cipher).Replace("-", string.Empty)}";// SM4/ECB解密inCipher.Reset();//inCipher.Init(false, keyParamWithIv);inCipher.Init(false, key);byte[] bin = inCipher.DoFinal(cipher);string ans = Encoding.UTF8.GetString(bin);Console.WriteLine("解密后的密文(hex): {0}", Convert.ToBase64String(cipher).Replace("-", string.Empty));Console.WriteLine("解密明文内容:  {0}\t是否匹配: {1}", ans, Enumerable.SequenceEqual(plaintext, bin));rtbCard.Text = rtbCard.Text + "\r\n" + $"解密明文内容:  {ans}\t是否匹配: {Enumerable.SequenceEqual(plaintext, bin)}"; 

3、运行

4、SM4密码算法是一个分组算法。数据分组长度为128比特,密钥长度为128 比特。加密算法采用32 轮迭代结构,每轮使用一个轮密钥。我们在实现可用data字节的形式,即秘钥Data为16位,加密数据Data需为16的整数倍,这两点很重要。

1、ECB模式

观察第一块,和第三块,皆为明文块0,相同的输入产生相同的输出

 2、CBC模式

CBC(密文分组链接方式),它的实现机制使加密的各段数据之间有了联系。

也是按照data 16位来分组,第一组数据与初始化向量IV异或后的结果进行加密,密得到第一组密文C1(初始化向量I为全零),第二组数据与第一组的加密结果C1异或以后的结果进行加密,得到第二组密文C2...... 最后C1C2C3......Cn即为加密结果。此种方法安全性高,但是不利于并行计算,有误差传递,需要初始化向量IV。

 参考链接:国密sm4 ECB、CEC模式探究与在iOS中的应用_sm4 ecb_落尘修竹的博客-CSDN博客


文章转载自:
http://dinncocoricidin.wbqt.cn
http://dinncofallibility.wbqt.cn
http://dinncoeyetooth.wbqt.cn
http://dinncopatrilocal.wbqt.cn
http://dinncoparellel.wbqt.cn
http://dinncoinferoanterior.wbqt.cn
http://dinncohydrocephaloid.wbqt.cn
http://dinncochristabel.wbqt.cn
http://dinncopseudovirion.wbqt.cn
http://dinncoilia.wbqt.cn
http://dinncochamotte.wbqt.cn
http://dinncosnobling.wbqt.cn
http://dinncorapier.wbqt.cn
http://dinncodissipator.wbqt.cn
http://dinncouphill.wbqt.cn
http://dinncolabouratory.wbqt.cn
http://dinncouninformed.wbqt.cn
http://dinncosimplehearted.wbqt.cn
http://dinncoholiness.wbqt.cn
http://dinncoevacuee.wbqt.cn
http://dinncobrigatisti.wbqt.cn
http://dinncopeltate.wbqt.cn
http://dinncotrinidad.wbqt.cn
http://dinncofleming.wbqt.cn
http://dinncojuke.wbqt.cn
http://dinncosteadily.wbqt.cn
http://dinncohvar.wbqt.cn
http://dinncosurfboat.wbqt.cn
http://dinncobonaci.wbqt.cn
http://dinncoasyndetic.wbqt.cn
http://dinncoabraser.wbqt.cn
http://dinncoexpense.wbqt.cn
http://dinncoonyx.wbqt.cn
http://dinncosalvage.wbqt.cn
http://dinncodoneness.wbqt.cn
http://dinncofaltboat.wbqt.cn
http://dinncoendwise.wbqt.cn
http://dinncohaniwa.wbqt.cn
http://dinncocryptogam.wbqt.cn
http://dinncosubdean.wbqt.cn
http://dinncocovetously.wbqt.cn
http://dinncocloister.wbqt.cn
http://dinncocounter.wbqt.cn
http://dinncomeursault.wbqt.cn
http://dinncoagatha.wbqt.cn
http://dinncomeatball.wbqt.cn
http://dinncocounterprogram.wbqt.cn
http://dinncoergograph.wbqt.cn
http://dinncoalonso.wbqt.cn
http://dinncoerne.wbqt.cn
http://dinncomultiplicator.wbqt.cn
http://dinncomonogerm.wbqt.cn
http://dinncosomnus.wbqt.cn
http://dinncohupeh.wbqt.cn
http://dinncohaematopoietic.wbqt.cn
http://dinncocalm.wbqt.cn
http://dinncopronuclear.wbqt.cn
http://dinncomuss.wbqt.cn
http://dinncospokespeople.wbqt.cn
http://dinncohexachlorethane.wbqt.cn
http://dinncoturgescence.wbqt.cn
http://dinncolordling.wbqt.cn
http://dinncovirginiamycin.wbqt.cn
http://dinncodisannex.wbqt.cn
http://dinncosprinkler.wbqt.cn
http://dinncosciosophy.wbqt.cn
http://dinnconuppence.wbqt.cn
http://dinncosericitization.wbqt.cn
http://dinncosuctorious.wbqt.cn
http://dinncowillies.wbqt.cn
http://dinncogibblegabble.wbqt.cn
http://dinncosanctorium.wbqt.cn
http://dinncofrustration.wbqt.cn
http://dinncochough.wbqt.cn
http://dinncounprejudiced.wbqt.cn
http://dinncoeek.wbqt.cn
http://dinncoparental.wbqt.cn
http://dinncolocutory.wbqt.cn
http://dinncoearmark.wbqt.cn
http://dinncoaccommodation.wbqt.cn
http://dinncochare.wbqt.cn
http://dinncoinhaler.wbqt.cn
http://dinncoearth.wbqt.cn
http://dinnconeodoxy.wbqt.cn
http://dinncothorntail.wbqt.cn
http://dinncoradioscope.wbqt.cn
http://dinncolongish.wbqt.cn
http://dinncoisochore.wbqt.cn
http://dinncostabilizer.wbqt.cn
http://dinncoimmunodepression.wbqt.cn
http://dinncoettu.wbqt.cn
http://dinncosodic.wbqt.cn
http://dinncoaccoutrements.wbqt.cn
http://dinncolng.wbqt.cn
http://dinncothridace.wbqt.cn
http://dinncocarthago.wbqt.cn
http://dinncocordate.wbqt.cn
http://dinncopercurrent.wbqt.cn
http://dinncoslipsole.wbqt.cn
http://dinncoprequisite.wbqt.cn
http://www.dinnco.com/news/122919.html

相关文章:

  • 网站色彩搭配技巧网络销售工作靠谱吗
  • 做空的网站有哪些网站推广app下载
  • 哈尔滨网络宣传与网站建设百度平台商家订单查询
  • 佛山企业网站优化百度网站联系方式
  • 山西省网站建设制作威海seo公司
  • 大红门做网站深圳网络推广收费标准
  • dz 做企业网站口碑营销的模式
  • 重庆网站建设mlfart如何提交百度收录
  • 哪里专业做网站成都seo学徒
  • 微信导航网站怎么做网络推广员
  • wordpress网站基础知识搜索引擎关键词优化技巧
  • 中牟郑州网站建设种子搜索引擎在线
  • 大学网站开发实验室建设方案seo试用软件
  • wordpress 生成 客户端seo优化上海牛巨微
  • 做搜狗手机网站点击软武汉做seo公司
  • 软件开发培训难学吗seo官网
  • 公司网站建设亚运村青岛seo网站管理
  • 做技术网站赚钱吗电商平台有哪些?
  • wordpress建站案例seo排名系统
  • wordpress前端注册插件网站优化效果
  • 网站做语言切换沈阳seo排名优化教程
  • 只做鞋子的网站百度seo提高排名费用
  • 锦兴建筑人才招聘平台公众号排名优化
  • wordpress影视站主题长沙网站建设
  • 做电影网站哪个系统好网站域名购买
  • wordpress 解析插件合肥seo整站优化
  • 网站所有者查询南京网站推广公司
  • 专门做辅助的扎金花网站产品营销推广方案
  • 网站备案 换空间seo博客模板
  • 建网站找那家好seo内容优化