没有合适的资源?快使用搜索试试~ 我知道了~
首页LVH密码学基础教程:深入理解Crypto101
LVH密码学基础教程:深入理解Crypto101
需积分: 15 4 下载量 19 浏览量
更新于2024-07-20
1
收藏 15.51MB PDF 举报
" Crypto101 密码学教程是LVH(Laurens Van Houtven)在2013年至2017年期间创作的一份基础加密学教育资源,它遵循Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) 许可协议。这个教程的目的是提供一个易于理解的密码学基础知识概览,而不是商业用途的替代品。 根据许可协议,用户可以自由地: 1. 分享:可以在任何媒体或格式下复制和分发这些材料,包括但不限于文本、博客文章、课堂讲义等。 2. 适应:允许对内容进行修改、改编和扩展,只要保持原始作者的荣誉,并且表明所做的更改,但不能暗示许可方对你的使用表示支持。 3. 非商业使用:禁止将这些材料用于商业目的,这意味着它们主要用于教育、研究或其他非盈利性质的活动。 4. 无额外限制:你不得添加法律条款或技术措施来限制他人按照许可协议规定的权利行事。 请注意,对于公共领域内的元素或者许可明确允许使用的部分,你不需要遵守此许可证。这是一份鼓励知识共享和传播的教育资源,旨在帮助学习者理解和探索密码学的基本原理和概念,如加密算法、哈希函数、公钥/私钥系统、数字签名等。对于希望深入了解密码学的人来说,这是一个宝贵的起点。"
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/9821279/bg10.jpg)
CHAPTER 4. ACKNOWLEDGMENTS 16
Following the public release,many more people contributed changes.
I’d like to thank the following people in particular (again, in no partic-
ular order):
• coh2, for work on illustrations
• TinnedTuna, for review work on the XOR section (and others)
• dfc, for work on typography and alternative formats
• jvasile, for work on typefaces and automated builds
• hmmueller, for many, many notes and suggestions
• postboy (Ivan Zubo ), for many reported issues
• EdOverow, for many contributions
.. as well as the huge number of people that contributed spelling,
grammar and content improvements. ank you!
![](https://csdnimg.cn/release/download_crawler_static/9821279/bg11.jpg)
Part II
Building blocks
17
![](https://csdnimg.cn/release/download_crawler_static/9821279/bg12.jpg)
5
Exclusive or
5.1 Description
Exclusive or, often called ”XOR”, is a Boolean
1
binary
2
operator that is
true when either the rst input or the second input, but not both, are
true.
Another way to think of XOR is as something called a”programmable
inverter”: one input bit decides whether to invert the other input bit, or
to just pass it through unchanged. ”Inverting” bits is colloquially called
”ipping” bits, a term we’ll use often throughout the book.
In mathematics and cryptography papers, exclusive or is generally
represented by a cross in a circle:
⊕
. We’ll use the same notation in
this book:
1
Uses only ”true” and ”false” as input and output values.
2
Takes two parameters.
18
![](https://csdnimg.cn/release/download_crawler_static/9821279/bg13.jpg)
CHAPTER 5. EXCLUSIVE OR 19
P
i
C
i
k
i
P
i
C
i
k
i
e inputs and output here are named as if we’re using XOR as an
encryption operation. On the left, we have the plaintext bit
P
i
. e
i
is just an index, since we’ll usually deal with more than one such bit.
On top, we have the key bit
k
i
, that decides whether or not to invert
P
i
. On the right, we have the ciphertext bit,
C
i
, which is the result of
the XOR operation.
5.2 A few properties of XOR
Since we’ll be dealing with XOR extensively during this book, we’ll
take a closer look at some of its properties. If you’re already familiar
with how XOR works, feel free to skip this section.
We saw that the output of XOR is 1 when one input or the other
(but not both) is 1:
0 ⊕ 0 = 0 1 ⊕ 0 = 1
0 ⊕ 1 = 1 1 ⊕ 1 = 0
ere’s a few useful arithmetic tricks we can derive from that.
![](https://csdnimg.cn/release/download_crawler_static/9821279/bg14.jpg)
CHAPTER 5. EXCLUSIVE OR 20
1. You can apply XOR in any order: a ⊕ (b ⊕ c) = (a ⊕ b) ⊕ c
2. You can ip the operands around: a ⊕ b = b ⊕ a
3.
Any bit XOR itself is 0:
a ⊕a = 0
. If
a
is 0, then it’s
0 ⊕0 = 0
;
if a is 1, then it’s 1 ⊕ 1 = 0.
4.
Any bit XOR 0 is that bit again:
a ⊕ 0 = a
. If
a
is 0, then it’s
0 ⊕ 0 = 0; if a is 1, then it’s 1 ⊕ 0 = 1.
ese rules also imply a ⊕ b ⊕ a = b:
a ⊕ b ⊕ a = a ⊕ a ⊕ b (rst rule)
= 0 ⊕ b (second rule)
= b (third rule)
We’ll use this property often when using XOR for encryption; you
can think of that rst XOR with
a
as encrypting, and the second one
as decrypting.
5.3 Bitwise XOR
XOR, as we’ve just dened it, operates only on single bits or Boolean
values. Since we usually deal with values comprised of many bits, most
programming languages provide a ”bitwise XOR”operator: an operator
that performs XOR on the respective bits in a value.
Python, for example, provides the
^
(caret) operator that performs
bitwise XOR on integers. It does this by rst expressing those two
剩余252页未读,继续阅读
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/81d16c5081f140cda7d81839bf9af5db_joelhy.jpg!1)
Joelhy
- 粉丝: 0
- 资源: 13
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 计算机人脸表情动画技术发展综述
- 关系数据库的关键字搜索技术综述:模型、架构与未来趋势
- 迭代自适应逆滤波在语音情感识别中的应用
- 概念知识树在旅游领域智能分析中的应用
- 构建is-a层次与OWL本体集成:理论与算法
- 基于语义元的相似度计算方法研究:改进与有效性验证
- 网格梯度多密度聚类算法:去噪与高效聚类
- 网格服务工作流动态调度算法PGSWA研究
- 突发事件连锁反应网络模型与应急预警分析
- BA网络上的病毒营销与网站推广仿真研究
- 离散HSMM故障预测模型:有效提升系统状态预测
- 煤矿安全评价:信息融合与可拓理论的应用
- 多维度Petri网工作流模型MD_WFN:统一建模与应用研究
- 面向过程追踪的知识安全描述方法
- 基于收益的软件过程资源调度优化策略
- 多核环境下基于数据流Java的Web服务器优化实现提升性能
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)