Comments (6)
首先,不太理解为啥您要使用,不同的构造,
您的问题在于,有没有一种可能sm2
加密是包含盐值计算的,所以你每次的加密字符串都不一样的。
from hutool.
首先,不太理解为啥您要使用,不同的构造, 您的问题在于,有没有一种可能
sm2
加密是包含盐值计算的,所以你每次的加密字符串都不一样的。
你说的对,我查到非对称加密算法一般都有随机数。但是我想实现对输入的每次加密都相同,有样例可参考吗
from hutool.
1.你这需求,我怎么理解都是对称加密
2.可以非对称加密,那就找一个可以固定填充的(padding),或者删除填充,但是会降低性能
# e, n代表公钥
e = xxxx
n = xxxxxxxxxxx
m = b'123456'
m = int.from_bytes(m, 'big')
c = pow(m, e, n)
#不带任何填充,随机数
c = c.to_bytes((c.bit_length() + 7) // 8, 'big')
# 密文c发送给服务器
send(c)
所以这个RSA
属于歪门邪道
的实现,可能需要你自己实现一个
from hutool.
Related Issues (20)
- CVE-2023-51075
- Convert.toInt得到的结果不正确 HOT 2
- 使用的是4.4.1的版本,想问下这个版本SimpleCache 是否存在死锁的场景 HOT 1
- SshjSftp cd逻辑有误 返回布尔值总是false HOT 1
- Setting.autoLoad 中 WatchMonitor监听回调问题 HOT 1
- excel导入日期相关问题 HOT 3
- HtmlUtil.removeHtmlAttr HtmlUtil.removeAllHtmlAttr 无法处理属性值里有空格的标签; 无法处理闭标签有属性值
- hutool-json toBean后的对象在dubbo3协议下传输序列化异常 HOT 7
- RSA 解密的时候出现了乱码 HOT 3
- 使用Convert转换实体对象异常 HOT 2
- 邮箱工具不支持openjdk17对应的jakarta.mail HOT 1
- ExcelUtil.getReader读取文件后更新某行某列,原文件无变化 HOT 1
- DateException: No format fit for date String HOT 4
- `Hutool.getAllUtils()` 获取不到 Base64 等工具类 HOT 3
- ChineseDate 农历日期中添加个方法为法定节假日(传统节日中包含信息过多,想要取得一个简化版) HOT 1
- Converter2 接口 是否需要 HOT 2
- TemplateEngine模板无法解析${paymentInfo.userService.operator}层级对象 HOT 1
- 邮件发送
- json bean处理字段序列化忽略 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 hutool.