ctf:xls加密_加密:爱丽丝和鲍勃的故事

ctf:xls加密

Today’s world runs on data. We’ve generated more data in the past two years than in our entire history combined. This data revolution has also allowed us to communicate more than ever before. Humanity revolves around communication, especially private communication — but how do we keep communication data private?

牛逼 ODAY的世界上运行的数据。 在过去两年中,我们生成的数据超过了整个历史的总和。 数据革命也使我们比以往任何时候都可以进行更多的交流。 人类围绕通讯,尤其是私人通讯展开,但是我们如何保持通讯数据的私密性呢?

Gone are the days where spies secretly exchanged envelopes with secret codes in them at a nondescript park bench. Gone are the days of the Enigma machine and substitution ciphers. Encryption has evolved quite a bit, and it holds some very interesting math. I love math, and the math involved in encryption is very elegant — and very clever.

间谍在不加描述的公园长凳上秘密交换带有秘密代码的信封的日子已经一去不复返了。 谜机器和替代密码的时代已经一去不复返了。 加密已经发展了很多,并且其中包含一些非常有趣的数学运算。 我喜欢数学,并且加密涉及的数学非常优雅-而且非常聪明。

什么是加密? (What is encryption?)

The goal of encryption is to take a message (in plain text) and scramble it so no one except the person you want to send the message to can read it. To understand this better, let’s take the example of the immortal Alice and Bob.

加密的目的是获取一条消息(以纯文本格式)并对其进行加密,因此,除了要发送该消息的人之外,其他任何人都无法读取它。 为了更好地理解这一点,让我们以不朽的爱丽丝和鲍勃为例。

Alice is madly in love with Bob, and she wants to tell him. However, she doesn’t want anyone else to know, just in case Bob doesn’t love her back. How can she send the message to Bob?

爱丽丝疯狂地爱上了鲍勃,她想告诉他。 但是,她不想让其他人知道,以防万一鲍勃不爱她。 她如何将消息发送给Bob?

One way would be to use a simple 1-to-1 encoding system — we map each character to another character and encrypt the message. Let’s say a = 1 , b = 2 and so on. So:

一种方法是使用简单的1对1编码系统-我们将每个字符映射到另一个字符并加密消息。 假设a = 1b = 2 ,依此类推。 所以:

'i love you' = 9 0 12 15 ...

Cool! Alice now has a nice, garbled message that no one can read! The only problem, of course, is that Bob can’t read it either. How does she tell Bob how to decrypt the message? Simple encryption schemes like this fail because there is no way to send the common key without using a more advanced encryption system. If Alice tries to encrypt the key, then the key to that key has to be sent too. So unless Alice is willing to pluck up the courage to talk to Bob in-person (secretly at a nondescript park bench of course), she can’t encrypt her message in such a simple way.

凉! 爱丽丝现在有一条很好的,乱码的消息,没人能读! 当然,唯一的问题是鲍勃也无法阅读。 她如何告诉鲍勃如何解密消息? 像这样的简单加密方案失败了,因为如果不使用更高级的加密系统就无法发送公用密钥 。 如果爱丽丝(Alice)尝试加密密钥,则也必须发送该密钥的密钥。 因此,除非爱丽丝(Alice)愿意鼓起勇气与鲍勃(Bob)面对面交谈(当然是秘密地坐在公园长椅上),否则她无法以这种简单的方式加密信息。

This is how kids make “secret codes”. Both parties have to be in on the cipher for it to work, but this throws us into the realm of paradox.

这就是孩子们制作“秘密密码”的方式。 双方都必须掌握密码才能起作用,但这使我们陷入了悖论的境地。

Public-key encryption introduces asymmetry to a simple cipher system. The idea is that the key used to encrypt the message is different from the key used to decrypt the message. Public-key encryption is notoriously difficult to wrap one’s head around, but I’ll try my best to explain. Here’s one analogy that I find helpful:

公钥加密将不对称性引入了简单的密码系统。 这个想法是,用于加密消息的密钥不同于用于解密消息的密钥。 众所周知,公钥加密很难让人,舌,但是我会尽力解释。 这是一个我认为有用的类比:

Imagine both Alice and Bob have a mailbox. Each mailbox has 2 different locks. One lock opens a small slot to put letters in, and the other opens the entire mailbox for mail to be taken out.

想象一下,爱丽丝和鲍勃都有一个邮箱。 每个邮箱有2个不同的锁。 一个锁打开一个小插槽以放入信件,另一个打开整个邮箱以取出邮件。

Image for post
The blue door is the only way to get mail out of the mailbox. Beautiful drawing by yours truly:)
蓝门是从邮箱中取出邮件的唯一方法。 真正的精美图画:)

The principle of public-key encryption is that everyone has the key used to encrypt messages (i.e. put mail through the red slot). This means that Bob has made many copies of the red key, and has even left a red key on top of the mailbox. However, only Bob has the blue key that is needed to actually see Bob’s mail. Thus, for Alice to send a secret message all she would have to do was encrypt it using Bob’s public key, and no one would be able to decipher it except Bob.

公钥加密的原理是每个人都有用于加密消息的密钥(即,将邮件放入红色插槽)。 这意味着Bob制作了许多红色密钥副本,甚至在邮箱顶部留下了红色密钥。 但是, 只有鲍勃拥有才能看到鲍勃的邮件的蓝键 。 因此,要让Alice发送一个秘密消息,她所要做的就是使用Bob的公共密钥对它进行加密,除了Bob之外没有人可以解密它

That’s how RSA encryption works.

这就是RSA加密的工作方式。

Let’s turn this into a more

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值