当前位置:网站首页>One-way hash function
One-way hash function
2022-06-10 14:56:00 【MyFreeIT】
One way hash function
function The rules
It is easy to calculate the output from the input , however , Push back the input through the output , Can only be exhausted by violence . Because Euler's theorem only gives forward derivation formula , No reverse derivation formula is given .
- Hash value, That is, the length of the hash value is fixed
- Abstract , That is, different messages Hash value Different
- One way , Irreversible
- Fast calculation
Application scenarios
One-way hash function It is a kind of cryptographic technology to ensure the integrity of information . For example, when storing a user's password , Just store the password Hash value that will do , Verification time , Just compare the two Hash value You can judge whether the entered password is correct .
- Encryption and decryption , password
- Interface signature , The received content is Hash value, And received Hash value Contrast , It is the process of signature verification .
- Integrity check
- Cloud disk second transmission ,Upload when , Produce according to document information Hash value, If it is related to a certain... On the server Hash value equal , Indicates that the file already exists , Directly through Hash value Association is enough .
for example :MySQL The community gives the hash value of the installation file , So that the user can verify whether the file has been tampered after downloading .
Realization way
Hash value( Hash value A summary of the news message digest, The fingerprint fingerprint), Equivalent to the identity of the message
One-way hash function(message digest function Message digest function , hash function , Hash function )
source message(pre-image)
String book = "It's a book";
System.out.println(book.hashCode());
System.out.println(Integer.toHexString(book.hashCode()));
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(book.getBytes());
System.out.println(new BigInteger(1, md.digest()).toString(16));
# -1420758063
# ab50f3d1
# "It's a book" = 505fe447e3d0257ff64fbd321849928f 16 Bytes / 32 Characters
# "It's a book1" = fd88076e4a8161b76efd6d518bc2c1ce 16 Bytes / 32 Characters
Other encoding and encryption methods :
MessageDigest.getInstance("SHA-512") 64 Bytes /128 Characters
#d0988c57f40e049be1aa371e1c9b58ae1bfe1028df925e6429689aff746a69e8
d9d447773d656a1df097b3def2fe36e36cf7b54a4679f486d84b0d4e675a3456
MessageDigest.getInstance("SHA-256") 32 Bytes /64 Characters
#aa6a7c05f39dcde57599f76c92e2295d86726e4d875e426bbe388941942ffa38
MessageDigest.getInstance("SHA-1") 20 Bytes /40 Characters
from Java9 Start supporting SHA-3
The hash algorithm
The bitcoin protocol uses SHA-256 and RipeMD160, among SHA-256 Also called hash256 and dhash,RipeMD160 Is in SHA-256 And then calculate on the result RipeMD160, Also called hash160.

reference 1
One way hash encryption https://blog.51cto.com/gozhuyinglong/4058818 ︎
边栏推荐
- 小程序实现全局数据共享
- 欧几里得算法求最大公因数 Go语言实现
- 2022 Nanjing International Smart site equipment exhibition
- Golang Beep包 播放mp3 无法获取总长度 streamer.Len()为0 其他格式却可以
- 一款完整的多用户微信公众平台开发源码,带文档免费分享
- Insight technology was selected into the "Aijian · privacy computing manufacturer panorama report" and was rated as a representative manufacturer of financial solutions
- AutoRunner自动化测试工具如何创建项目-Alltesting|泽众云测试
- 【报名】解决科技创业者核心关切,「星云计划公开课」线上招生开启
- Golang beep package playback MP3 cannot get the total length streamer Len() is 0, but other formats can
- Golang []byte to file
猜你喜欢

Consumption mode of Message Oriented Middleware

How the WordPress administrator user name was leaked

利用 GDB 快速阅读 postgresql 的内核代码

Meta公司新探索 | 利用Alluxio数据缓存降低Presto延迟
![[logodetection data set processing] (2) draw the label box of the training set picture](/img/66/6c19b80b99d1e3ce50bac439e0e903.jpg)
[logodetection data set processing] (2) draw the label box of the training set picture

小程序网络请求Promise化

共创地市价值空间,2022年华为商业分销地市百城行·宁波站成功举办

2022 the 14th Nanjing International artificial intelligence product exhibition

Flutter drawer learning summary 6

One-way hash function
随机推荐
BigDecimal 去除末尾多余的0
Even some people say that ArrayList is twice as large. Today, I will take you to tear up the ArrayList source code
what‘t the meaning of “de facto“
Sanzi chess (implemented in C language)
At the early stage of product development, do you choose to develop apps or applets?
Adding, deleting, modifying and querying databases with JDBC
【LogoDetection 数据集处理】(1)将数据集切分为训练集和验证集
Flutter drawer learning summary 6
CVPR 2022 oral | SCI: fast, flexible and robust low light image enhancement
Golang beep package playback MP3 cannot get the total length streamer Len() is 0, but other formats can
How to implement the association between interfaces in JMeter?
Flutter Icon Stack LIsttitle... Learning summary 3
one
Binary tree and Figure 2
Gin blog summary 1
小程序实现全局数据共享
Mutual transformation among lists, arrays and tensors
100003 words, take you to decrypt the system architecture under the double 11 and 618 e-commerce promotion scenarios
【LogoDetection 数据集处理】(3)将训练集按照类别划分为多个文件夹
Beijing / Shanghai internal promotion | recruitment of full-time interns in the system and network group of Microsoft Research Asia