Internet History, Technology, and Security(week8)——Security: Encrypting and Signing

Hiding Date from Ohters

  • Security Introduction

Alice and Bob是密码学、博弈论、物理学等领域中的通用角色之一。Alice(代表A)Bob(代表B)一般是形容好人的,用来描述通讯双方。通讯中也会出现一些不怀好意的人(People with bad intent),比如窃听者(Eve),E代表

Security is Always a Tradeoff,安全总是一种充满妥协的权衡。对于安全这回事,几乎不存在所谓的Perfect Security,我们总是在权衡,根据实际情况尽可能地去确保安全。

信息安全的CIA三要素:

  • Confidentiality(保密性)
  • Integrity(完整性)
  • Availability(可用性)
  • Security - Encryption and Confidentiality

Plaintext(明文)是指待加密的信息,即加密前能够让人理解的原始数据。Ciphertext(密文)是明文加密后的版本,只有加密的人知道如何破解。明文转换为密文称作Encryption(加密),把密文转换回明文称作Decryption(解密)。一个加密系统的强度取决于加密解密技术与Key(密钥)的长度,密钥指一种将明文转换成密文的算法或机制。

密钥分为私钥公钥私钥(private key)是指私有的密钥。公钥(public key)是指密钥是公开的。

一般来说,私钥对称的,加密解密用的是同一套,例如凯撒密码。而公钥一般非对称的较多,信息发送者用公钥加密,而信息接收者则用私钥解密。比较著名的公钥算法是RSA算法

凯撒密码是一种古老但是却应用广泛的对称密码,其原理是把英文字母按照字母表顺序以移动一定的位数来加密和解密,例如图中是按推后三位对应,用D来代表A、用E来代表B,依次类推。

Insure Date Integrity

  • Security - Integrity and Signatures

Cryptographic Hash(密码散列表)是一种广泛使用的信息安全技术,将任意数据转换成定长的比特串,可以用来保密明文验证完整性。

由于担心数据库被攻击而泄露密码,一般网站不会以明文形式存储用户密码,而是当用户设置密码时,计算其哈希值储存。在登录时,会将用户输入内容转换成哈希值与数据库中存储的进行匹配。因此,一个值得信任的网站永远不会把密码发给用户,而是只能重设密码。

Digital Signature(数字签名)是只有信息的发送者才能生成的他人无法伪造的一段数字串,一般用于明文发送时确认发送方和验证信息完整性,是非对称密钥加密技术密码哈希技术的应用。数字签名中存在对公钥密码的逆运用,即用私钥加密,用公钥解密。用私钥加密的消息称为签名,只有拥有私钥的用户可以生成签名。用公钥解密签名这一步称为验证签名,所有用户都可以验证签名。

如上图,Alice要给Bob发信息“Eat More Ovaltine”(多吃点阿华田),二人约定了一个Secret,即末尾的Santa。当信息发送时先将Eat More OvaltineSanta连起来Hash加密得到a79540,将其与之前的Eat More Ovaltine连起来,因此发送方发送的其实是Eat More Ovaltinea79540。而接收方接收信息时将二者拆分,重新分成了Eat More Ovaltinea79540,由于只有他们二人知道SecretSanta,因此如果信息被修改过,即信息已经不是Eat More Ovaltinea,那么加上SantaHash加密后得到的就一定不是a79540

小结:

原文地址:https://www.cnblogs.com/chelinger/p/10887965.html

时间: 2024-08-30 09:42:10

Internet History, Technology, and Security(week8)——Security: Encrypting and Signing的相关文章

Chapter 2 User Authentication, Authorization, and Security(2):创建登录帐号

原文出处:http://blog.csdn.net/dba_huangzj/article/details/38705965,专题目录:http://blog.csdn.net/dba_huangzj/article/details/37906349 未经作者同意,任何人不得以"原创"形式发布,也不得已用于商业用途,本人不负责任何法律责任. 前一篇:http://blog.csdn.net/dba_huangzj/article/details/38657111 前言: 登录帐号是定义

Chapter 7 Integrity(完整性), Views(视图), Security(安全性), and Catalogs(目录)

from Database Design to Physical Form CREATE TABLE integrity constraints (完整性约束) CREATE VIEW Security The GRANT & REVOKE statements Catalogs Schemas Introduction ->The DBA(数据库管理员) must begin by creating the tables and constraints(约束) and loading th

Chapter 2 User Authentication, Authorization, and Security(1):选择Windows和SQL 身份验证

原文出处:http://blog.csdn.net/dba_huangzj/article/details/38657111,专题目录:http://blog.csdn.net/dba_huangzj/article/details/37906349 未经作者同意,任何人不得以"原创"形式发布,也不得已用于商业用途,本人不负责任何法律责任. 前一篇:http://blog.csdn.net/dba_huangzj/article/details/38656615 前言: SQL Ser

Spring Security(三)

Spring Security(三) 个性化用户认证流程 自定义登录页面 在配置类中指定登录页面和接收登录的 url @Configuration public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter { @Bean public PasswordEncoder passwordEncoder() { return new MyPasswordEncoder(); } @Override protected

SpringBoot集成Spring Security(4)——自定义表单登录

通过前面三篇文章,你应该大致了解了 Spring Security 的流程.你应该发现了,真正的 login 请求是由 Spring Security 帮我们处理的,那么我们如何实现自定义表单登录呢,比如添加一个验证码- 源码地址:https://github.com/jitwxs/blog_sample 文章目录 一.添加验证码 1.1 验证码 Servlet 1.2 修改 login.html 1.3 添加匿名访问 Url二.AJAX 验证三.过滤器验证 3.1 编写验证码过滤器 3.2 注

SpringBoot集成Spring Security(5)——权限控制

在第一篇中,我们说过,用户<–>角色<–>权限三层中,暂时不考虑权限,在这一篇,是时候把它完成了. 为了方便演示,这里的权限只是对角色赋予权限,也就是说同一个角色的用户,权限是一样的.当然了,你也可以精细化到为每一个用户设置权限,但是这不在本篇的探讨范围,有兴趣可以自己实验,原理都是一样的. 源码地址:https://github.com/jitwxs/blog_sample 文章目录 一.数据准备 1.1 创建 sys_permission 表 1.2 创建 POJO.Mappe

Internet History,Technology,and Security -Security: Encrypting and Signing(Week8)

Week 8 Security: Encrypting and Signing This week we start two weeks of Internet Security. It is a little technical but don't worry - we stay at a very high level and I am confident that if you are still keeping up with the class that you will enjoy

Internet History, Technology and Security (Week 2)

Week 2 History: The First Internet - NSFNet Welcome to week 2! This week, we'll be covering the history of the first internet: NSFnet. In the 1960s and 1970s, there was a great deal of research done to build the first wide-area packet switched networ

Internet History, Technology and Security (Week 4)

Week 4 History: Commercialization and Growth We are now moving into Week 4! This week, we will be covering commercialization and growth. The late 1990's saw the web and Internet used increasingly to revolutionize how business was done. Companies like