Comments (3)
我把你的私钥用 xxxxx隐藏了,在公共地方不要随意给私钥,通过私钥是可以算出来公钥的,
from phpsm2sm3sm4.
$m2EncryptData = bin2hex(base64_decode($str)); 加密串如果base64
// var_dump($m2EncryptData);
$c1 = substr($m2EncryptData,0,130); //前面有04,没有的话就128 相应的后面也修改成128
$c3 = substr($m2EncryptData,-64);
$c2 = substr($m2EncryptData,130,strlen($m2EncryptData)-130-64);
$m2EncryptData = $c1.$c3.$c2;
这样就行了,
from phpsm2sm3sm4.
嗯嗯,明白了。感谢@lpilp花时间耐心的解答
from phpsm2sm3sm4.
Related Issues (20)
- 1.0.7版本 不兼容 以前版本 HOT 4
- RtSm2 verifySignOutKey方法返回值标注应为 bool HOT 1
- 与 Go 语言的 demo 调试不通 HOT 2
- pkcs8 格式私钥 怎么转换 pkcs1格式呢? HOT 12
- 问个问题:JAVA中的SM3WITHSM2,在这个项目中要如何调用、配置? HOT 1
- 再问个问题我的私钥是pfx后缀的,跟代码里的公私钥不一样,要怎么处理? HOT 6
- HMAC-SM3 请问这个能否实现呢 HOT 3
- 求大佬帮看看sm2签名,java的可以通过,但是php的签名就没有办法通过,对接国家医保支付 HOT 1
- 大神你好,请问 hmac-sm3 具体怎么做呢? HOT 1
- SM4 golang 版和 php 版本加密后数据不一致,求指点 HOT 6
- 使用sm4-ecb提示Uncaught Exception: 秘钥长度为16位 HOT 2
- 求助SM2解密问题 HOT 7
- 对接招行付款码收款支付,需要对终端数据进行加密,并且在要对随机私钥进行数字信封加密,进行测试时信封加密和招行不一致,加密结果也不一致 HOT 9
- sm2 缺少文件 HOT 4
- 调用CBS8 总提示致命错误 HOT 3
- 对接招行时,对招行的数据返回进行验签时,偶现错误 ASN.1 Parser Exception at offset XX: Integer not minimally encoded HOT 2
- does not comply with psr-4 autoloading standard HOT 8
- Uncaught FG\ASN1\Exception\ParserException: ASN.1 Parser Exception HOT 5
- 对接国家医保平台的sm2withsm3的时候发现,这个签名的结果和java的签名不一致 HOT 7
- 加密无法解密 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpsm2sm3sm4.