当前位置:网站首页>01-BTC-密码学原理
01-BTC-密码学原理
2022-07-17 00:07:00 【晏日雨】
目录
前言
学习肖臻老师的《区块链技术与应用》公开课笔记,供学习参考。
比特币中的密码学原理
1.哈希
- 密码学中使用的哈希函数(crypotographic hash function)
密码学中使用的哈希函数有两个重要的性质
- collision resistance(防碰撞)
collision指哈希碰撞:x≠y H(x)=H(y) 两个不同的输入,输出却是相等的。因为输入空间总大于输出空间,因此不可避免。除非暴力求解,很难根据x找到y。
根据人们的实践经验已证实,哈希碰撞是不可人为制造的。
- hiding(不可逆)
哈希函数的计算过程为单向的不可逆的。该性质的前提是输入空间足够大,分布较均匀。
以上两种性质结合在一起,可实现digital commitment (又称为digital equivalent of a sealed envelope):
将预测结果X输入计算哈希值Y,公布哈希值Y,最后公布X。在此过程中X不可被篡改。
- 比特币中使用的哈希函数
比特币中使用的哈希函数在密码学的基础上增加了一个性质:
puzzle friendly (不可预测)
即哈希值的计算是不可预测的
2.签名
在比特币中开户是在本地创立一个公私钥匙对(public key ,private key),来自非对称的加密技术。
在信息交流中公钥用来加密以及验证签名,私钥用来解密和签名,公钥和私钥互不相同。当公钥和私钥相同时,为对称加密。在非对称的加密技术中公钥就像我们的银行卡的卡号,而私钥是我们的银行卡的密码,别人如果给我们转钱只需要知道我们的银行卡号就可以了。
但是产生公私钥以及签名的时候都需要有一个好的随机源,防止产生相同的公私钥或者泄露私钥。
边栏推荐
- uni-app微信公众号(5)——新增、修改地址
- Express中间件的分类及使用
- es可选链
- elemtnui 表格如何修改某行文字颜色(elemtnui table 修改某行文字颜色)
- Nodejs cross domain CORS
- Libtomcrypt密码库的使用
- Node的数据库编程(MySQL),增删改查
- promise
- JS高阶函数 filter/map/reduce
- The applet is embedded in the web page, jumps to the applet and transmits parameters. The wechat applet realizes the authorization of official account to obtain openid
猜你喜欢

TCP与UDP,TCP服务器与客户端,UDP服务器与客户端

Single page application spa and multi page application MPa

uni-app微信公众号(5)——新增、修改地址

Uniapp development, upload pictures in the app and send them directly to OSS

Uni app wechat applet - Mall (6) - my home page

Uni app wechat applet - Mall (7) - Product Details

Text indent in uniapp doesn't work, and the indentation in the first line of uniapp doesn't work. How to solve it?

单页面应用 SPA 和多页面应用 MPA

使用redis - zset做排行榜

Uni app wechat official account (1) - Web page authorization login
随机推荐
05_回顾Object.defineProperty
JS高阶函数 filter/map/reduce
Use bat to automatically execute CMD commands (multiple commands or a single command)
The applet is embedded in the web page, jumps to the applet and transmits parameters. The wechat applet realizes the authorization of official account to obtain openid
How does the website count the number of visitors? How to install and use 51la?
tp-watermark. JS web page add watermark plug-in
qs模块是?
object-fit:cover; It doesn't work in the applet. How to deal with the deformation of the applet image
JS get the suffix format of a file name
14 检查整数及其两倍数是否存在
Yii2反序列化漏洞复现
08-BTC-分叉
软件漏洞分析入门(四)
promise
Quine injection of SQL injection
elemtnui 表格如何修改某行文字颜色(elemtnui table 修改某行文字颜色)
object-fit:cover;在小程序中不起作用,小程序图片变形了如何处理
02_数据绑定
不好意思各位 最近在银行有点事情要处理 耽搁了
Uni app wechat official account (5) - add and modify addresses