Comments (13)
后端用的国密工具是gmhelper,还是自己封装的bouncycastle?如果是前者,那么可能是cipherMode没有选对,或者密文不是以0x04字节开头
from sm-crypto.
根据标准,密文前面需要加上0x04
from sm-crypto.
大佬好, 请教一个问题 ,
我使用的是c#后端
同秘钥情况下,前后都能加解密,但是就是不能交叉加解密
这是为啥呢,有什么解决办法吗
from sm-crypto.
@756616071 看看密文第一个字节是不是0x04
from sm-crypto.
在后端看是不是 0x40吗
from sm-crypto.
不兼容有几个常见问题,比如第一个字节有0x04,C1C2C3/C1C3C2,需要查文档
from sm-crypto.
from sm-crypto.
没有 0x40
from sm-crypto.
后端使用的是c1c2c3
from sm-crypto.
@756616071 看源码,两边的标准必须一样
from sm-crypto.
标准指的是字符串标准吗
from sm-crypto.
请问这个问题解决了吗?我也遇到了,nodejs 加密解密正常,java 那边解密失败;java 给的密钥是 16位的,我转成 32位的 hex 进行加密,但是 java 解密不了
from sm-crypto.
给后来的兄弟提醒下,一般后端是以04开头密文来解密的, 该库没有属于去除04的,解密是库的函数自动加上的, 其他的后端库如go,属于密文必须04开头的,所以需要在传给后端密文时候手动加上04
from sm-crypto.
Related Issues (20)
- 提供一个高性能的Java版,采用了BC库
- 一些其他的版本实现,方便取用 HOT 3
- sm4.encrypt的key要求是128比特,可是demo那里的字符是32位。 HOT 5
- sm4.encrypt的key要求是128比特,可是demo那里的字符是32位。
- uniapp 提示未定义 HOT 4
- sm4密钥 HOT 7
- hi, 这个工具又从证书获取公钥或私钥的方法吗? HOT 7
- 什么时候支持ts呀? HOT 1
- 请问能支持国密csr生成吗? HOT 4
- 使用前端进行签名后,使用golang后端进行验签,发现验证失败。 HOT 1
- 鸿蒙OS SM2签名中文,后端验签失败,去掉中文就可以验签通过 HOT 1
- sm3 hmac 算出来的结果和 crypto 算出来的结果不一样 HOT 1
- iv is invalid HOT 3
- 生成的密钥对结构和java的不一样 HOT 2
- sm4加密文件后无法解密 HOT 7
- sm4 加密报错
- 在使用代码混淆后,无法加解密 HOT 1
- vue项目,计算视频文件SM3,大一点的就崩溃 HOT 5
- SM2解密 后台采用hutool,密文加了04,但是还是偶发解密不了,报错InvalidCipherTextException: invalid cipher text HOT 1
- IE 出现兼容问题,建议修改 packjson 的main的路径 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 sm-crypto.