<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[softt的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/softt</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; softt]]></copyright><item><title><![CDATA[SM2 签名验签 注意事项]]></title><link>https://blog.csdn.net/softt/article/details/141570577</link><guid>https://blog.csdn.net/softt/article/details/141570577</guid><author>softt</author><pubDate>Mon, 26 Aug 2024 18:57:02 +0800</pubDate><description><![CDATA[在A程序计算输出结果，找B工具验证算法正确性时，要特别注意待签名数据处理情况，否则会出现两者数据验签失败，细心一点的可以发现其中的奥秘，有些工具会标记_E后缀以示区分（Verify_E不做预处理）。2）不做预处理1、预处理2过程处理，直接将待签名裸数据X给到签名验签函数生成签名R+S (下面示例数据属于这种，要求数据输入长度为32个字节)待签名裸数据X，预处理1得到Z，预处理2得到Ex值，Ex值给到签名验签函数生成签名R+S。可知，单纯SM2签名、验签函数的入参待签名数据这块是不会进行预处理。]]></description><category></category></item><item><title><![CDATA[国内开源密码库]]></title><link>https://blog.csdn.net/softt/article/details/140965245</link><guid>https://blog.csdn.net/softt/article/details/140965245</guid><author>softt</author><pubDate>Tue, 06 Aug 2024 20:31:02 +0800</pubDate><description><![CDATA[罗列下国内开源的密码库资源，不完全统计。3、华为 - openHiTLS。4、腾讯 -  KonaSSL。2、阿里 - tongsuo。5、江南天安 - TASSL。1、北大 - GMSSL。]]></description><category></category></item><item><title><![CDATA[关于SM2算法结果的那些事]]></title><link>https://blog.csdn.net/softt/article/details/139978608</link><guid>https://blog.csdn.net/softt/article/details/139978608</guid><author>softt</author><pubDate>Wed, 26 Jun 2024 11:08:20 +0800</pubDate><description><![CDATA[1、SM2公钥 64个字节 ： X + Y ，X和Y各32个字节2、SM2私钥 32个字节3、SM2签名 64个字节： R+S，R和S各32个字节4、SM2加密后密文：C1 + C3 + C2，C1为X+Y 64个字节，C3为Hash 32个字节，C2为密文长度与明文等长。]]></description><category></category></item><item><title><![CDATA[Android JNI里面malloc分配内存重复问题]]></title><link>https://blog.csdn.net/softt/article/details/139930922</link><guid>https://blog.csdn.net/softt/article/details/139930922</guid><author>softt</author><pubDate>Mon, 24 Jun 2024 17:04:53 +0800</pubDate><description><![CDATA[由于子函数需要，子函数里面创建了另外一个char临时变量B，使用了malloc分配空间，通过LOGD("%p",指针)分别打印分配空间的指针C、B时，C和B不一样。1、在父函数里面，创建了一个char变量A，使用了malloc分配空间，然后将这个变量A调用子函数fun1处理。由于子函数需要，子函数里面创建了另外一个char临时变量B，使用了malloc分配空间，通过LOGD("%p",指针)分别打印分配空间的指针A、B时，A和B不一样。]]></description><category></category></item><item><title><![CDATA[关于国密SSL的那些事]]></title><link>https://blog.csdn.net/softt/article/details/138286956</link><guid>https://blog.csdn.net/softt/article/details/138286956</guid><author>softt</author><pubDate>Sun, 28 Apr 2024 18:27:36 +0800</pubDate><description><![CDATA[国密SSL顾名思义就是指参考密码标准实现的https，这里面有2个显著特点：1）密码套件国密化，即非RSA国际套件，类似ECC_SM4_GCM_SM3；2）引入双证书机制，即签名和加密分离，传统https国际采用单证书；]]></description><category></category></item><item><title><![CDATA[关于SM2算法 ASN.1编码 - 签名长度]]></title><link>https://blog.csdn.net/softt/article/details/134941449</link><guid>https://blog.csdn.net/softt/article/details/134941449</guid><author>softt</author><pubDate>Tue, 12 Dec 2023 11:15:30 +0800</pubDate><description><![CDATA[密码学 SM2 签名 长度 ANS.1 DER]]></description><category></category></item><item><title><![CDATA[关于SM2算法 ASN.1编码 踩过的坑 - 加密]]></title><link>https://blog.csdn.net/softt/article/details/134739597</link><guid>https://blog.csdn.net/softt/article/details/134739597</guid><author>softt</author><pubDate>Fri, 01 Dec 2023 17:22:52 +0800</pubDate><description><![CDATA[在某些项目开发过程中，或多或少很多底层安全OS系统或者算法库，都引入了openssl或者gmssl的一些内容来实现算法，这样就导致算法运算结果并不是完全按照国密标准的裸数据，而是经过编码之后的数据，编码之间的对齐对上层业务系统互通带来的一些挑战。经过分析发现，C1y的数据也是对的，原因是C1y丢失的那个字节是为0，不计算在长度里面，在实际系统中，需要进行补0 操作。C1y的长度不一样，正常为32个字节，不正常的为31个字节，如果直接取数据会导致业务异常。]]></description><category></category></item><item><title><![CDATA[关于SM2算法 ASN.1 DER编码]]></title><link>https://blog.csdn.net/softt/article/details/134573298</link><guid>https://blog.csdn.net/softt/article/details/134573298</guid><author>softt</author><pubDate>Thu, 23 Nov 2023 15:04:58 +0800</pubDate><description><![CDATA[关于为什么02 21后面会加一个补位00，这个需要根据C1x的第一个字节是否大于128（0x80），如果大于或者等于128，则需要补位00，否则为 02 20+ 32个字节C1x数据；编码格式2（中，71个字节）: 30 47 + 02 21 00 + R + 02 20 + S  或者   30 47 + 02 20 + R + 02 21 00 + S。022100 ，02代表类型， 21代表数据长度，00 代表补位（同理C1x），后面为C1y。长度大于127，多字节编码，第二个字节最高位为1。]]></description><category></category></item></channel></rss>