【Coursera】Security Introduction -Ninth Week(1)

前言

Coursera 的 Internet History,Technology,and Security 进入最后一周的学习了,在这最后一周内,需要进行的内容是 public-key 公钥系统的讲解 和 一些改进。随着课程的结束,这个暑假也接近尾声了,回想已经结束的暑假生活,是充实而又有意义的,是一个很令人难忘的暑假。
初识这门课程,以 生动的历史 开篇,随后切入 并不乏味的 技术介绍篇,最后以对 网络安全 这一相对其它而言 “新兴” 的方向的介绍收尾。主讲人Chuck幽默风趣,从例子中学习知识巩固知识,并且伴随着每一个单元的课程考试来回顾与复习,不失为一种好的学习方法。

Public Key Encryption & Confidentiality

Review: Terminology

Confidentiality

  • Prevent unauthorized viewing of private information.

Integrity

  • Information is from who you think it is from and has not been modified since it was sent.

Public Key Encryption

Proposed by Whitfield Diffie and Martin Hellman in 1976.
Public-key cryptosystems rely on two keys which are mathematically(精确地) related to one another. Also called asymmetric-key(不对称的,与密钥相反) cryptosystem.
One key is called the public key and is to be openly revealed to all interested parties.
The second key is called the private key and must be kept secret.

在之前的课程中,在密钥的内容中,提到了利用digest和shared secret来验证数据的安全性(Integrity),通过计算SHA值(digest)然后进行比较,但是困难在于,在当今的Internet中,进行shared secret本身就是一件很困难的事情,因为中间媒介的不安全性。你不能总是把所有人“叫到一起”然后给出公共的secret。

公钥系统是需要身份认证的,它完美的解决了密钥中shared secret的问题。
不对称的密码系统:它依靠的是两个key,这两个key并不一样。跟之前的课程中,密钥用于加密和解密的key相同的机制 不一样:加密的key与解密的key不相同。
在电脑系统内部生成两个key,你向外界发送public key,public key是用于encryption加密的。而你自己保存的private key是用于解密的,加密的 public key 和解密的 private key 是紧密相关的。很难计算key的长度,因为它们都足够长。

Public key

A message encrypted by one of the keys can only be decrypted with the other key.
It is computationally(计算地) infeasible(不可执行的) to recover one key from the other.
Public-key cryptosystem solve the proble of secure key distribution because the public key can be openly revealed to anyone without weakening the cryptosystem.

public-key 是用来做加密工作的,很难从 public-key 解得 private-key,同时使用 public-key 对文本进行加密也是很困难的。
但是 很困难 并不意味着 不可能,我们在之前就提到了,除非你什么都不发送,让 发送的信息完全安全 是一件不可能的事情。
每一个人都知道破解它的方法,但是计算机计算的速度并没有那么快来得出答案,如果计算机变快了,我们需要做的只是增长密码即可。
所以 从可计算性的角度来看,破解它基本是一件基本不可能的事情。除了暴力破解它之外,没有什么好的方法来从public-key破解出private-key。

Generating Public/Private Pairs

Choose two large random prime numbers.
Mutiply them
Compute public and private keys from that very large number.

如果你想要使用公钥密码系统的话,你需要生成一个pair:随机 选择两个 非常长的素数,然后对他们进行乘法运算,得到一个更大的数字,然后经过一系列的操作,你可以从这个 巨大的数字 中获取 公钥的 public-key 和 private-key。
获取过程中最精华的部分,就是所选取的这两个素数,public-key 和 private-key 就是基于这两者找到的。

Public Key Math(light)

Some functions are easy in one directions, but in the other, not so much!
Example: What are the factors of 55124159?
If you know that one of the factors is 7919, it's also easy to find 6961!


Amazon 向用户发送了public key,中间的第三方有可能获取这个public key,用户通过这个public key加密了请求,发送给Amazon,中间的第三方也有可能截获这个请求,但是破解它相当之困难,基本接近不可能,Amazon 得到了这个数据报,并且通过 一直在自己手中从未发送的唯一对应的 secret key 解密了请求。

Secure Socket Layer(SSL) Security for TCP

我们利用这个 secret key 和 public key 的密码机制,对HTTP进行了改进,在数据模型中增加了一个小型的Layer。
HTTP 是应用层的一个协议,在应用层(application layer)和运输层(transport layer)之间,有一个小的层次:SSL。工作就是 利用公钥密码系统,加密和解密应用层传递的信息。
应用层发送的数据,都是未加密的。在TCP/IP四层模型的其他位置,比如中间的路由器,IP层,光纤等等,它们并不能区别加密的信息和未加密的信息,它们只是做了运输的工作。

Transport Layer Security(TLS) / SSL / HTTPS

Used to be called SSL and HTTPS.
Can view it as an extra layer between TCP and application layer.
It is very difficult but not impossible to break this security -normal people don't have the necessary compute resoureces to break TLS.
Encrypting and decrypting takes resources -so we use it for things when it is needed.
The IP and TCP is unware whether data has been encrypted.

我们能够看到 一个URL连接的首部 是HTTPS。

Secure Application Protocols

They are often secure and unencrypted application protocols.

  • http://www.facebook.com
  • https😕/www.facebook.com
    Your browser tells you when using a secure connection -you should never type passwords into a non-secure connections.
    Especially over wireless(无线) -especially at a security conference(会议)...

现在很多公司开始着手在服务器内安装安全协议,尽管这很昂贵。作为用户的我们需要注意的是,不要在没有使用https的URL链接的网页中 输入一些敏感的信息(比如密码)。一定要确保这样做。

但是我们仍然有可能丢失我们的数据:
(1)有病毒入侵了你的laptop,记录下了你的密码或者其他的信息。
(2)第三方欺骗了你,使你误以为第三方是你要发送的目的地,并向第三方发送数据报。

2016/8/13

posted @ 2016-08-12 14:39  Wasdns  阅读(175)  评论(0编辑  收藏  举报