Security Authentication

DAY1

CIA:

confidentiality:prevent unauthorized read of information

integrity:detect unauthorized writing of information

availability:data is available in a timely manner when needed

accountability

beyond CIA:

1.crypto

2.protocols

3、access control:

A.authentication:passwords and biometrics、

B.authorization:Firewalls、multilevel security

4.software:包含1、2、3

Security Authentication_第1张图片

 B is more stable than A.

Ipsec VPN 与 SSL VPN 的区别

1.IPsec VPN 多用于 “网一网” 连接,SSL VPN 用于 “移动客户一网” 连接。SsL VPN 的移动用户使用标准的浏览器,无需安装客户端程序,即可通过 SSL VPN 隧道接入内部网络:而 IlPSec VPN 的移动用户需要安装专门的 IPSec 客户端软件。

2.SSL VPN 是基于应用层的 VPN, 而 IPsec VPN 是基于网络层的 VPN。IPsec VPN 对所有的 IP 应用均透明:而 SSL VPN 保护基于 Web 的应用更有优势,当然好的产品也支持 TCP/UDP 的 C/S 应用,例如文件共享、网络邻居、Ftp、Telnet、Oracle 等。

3.SSL VPN 用户不受上网方式限制,c 而 IPSec 客户端需要支持 “NAT 穿透” 功能才能穿透 Firewall,而且需要 Firewall 打开 UDP500 端口。

4.SSL VPN 只需要维护中心节点的网关设备,客户端免维护,降低了部署和支持费用。而 IPSec VPN 需要管理通讯的每个节点,网管专业性较强。

5.SSL VPN 更容易提供细粒度访问控制,可以对用户的权限、资源、服务、文件进行更加细致的控制,与第三方认证系统 (如: radius、AD 等) 结合更加便捷。而 IPSec VPN 主要基于 IP 五元组对用户进行访问控制。

DAY2

转载自:

密码学和对称密钥算法 - 知乎

转载自:https://zh.wikipedia.org/wiki/%E5%85%AC%E5%BC%80%E5%AF%86%E9%92%A5%E5%8A%A0%E5%AF%86

一、密码学和对称密钥算法

1、密码学的目标

  • 密码学的基本目标:保密性、完整性、身份验证、不可否认
  • 1)保密性:确保数据在静止、传输和使用三种不同状态下始终保持私密
  • 2)完整性:确保数据没有被人未经授权更改
  • 3)身份验证:验证系统用户所声称的身份
  • 4)不可否认性:向接收者保证,消息来自发送者,没有人冒充他

2、密码类型

  • 代码代号:作用于单词和短语
  • 密码:作用于字符和位
  • 移位密码:通过一种加密算法重新安排明文消息的字母,形成密文
  • 替换密码:通过加密算法用一个不同的字符替换明文消息的每个字符或位
  • 单词密码本:单次密码本位明文消息中每个字母使用一个不同的替换字母表,密码本随机生成,只使用一次,密钥长度至少和明文一样长,是一种极强的替换密码
  • 运动密钥密码:因为需要物理交换密码本,单次密码本执行起来非常困难,因此发明了运动密码本,选择一本普通的书,指定密钥为书中一段内容
  • 块密码:在消息块上运算,在同一时间对整个消息执行加密算法
  • 流密码:一次在消息的一个字符或一个位上进行

二、现代密码学

1、密码密钥

现代密码系统不依靠算法的保密性,把算法开源出来,它的安全性依靠密码密钥。

2、对称密钥算法:加密解密使用同一个私人密钥

  • 密钥分发是主要问题:如何约定相同的密钥
  • 对称密钥加密法不提供不可认性,因为C、S两端都有密钥
  • 算法缺乏可伸缩性,是n平方的规模复杂度
  • 密钥必须经常重新生成,加入离开开销大

3、非对称密钥算法

每个用户都有两个密钥,一个公钥一个私钥,公钥是公开的,私钥只有自己知道。使用公钥加密,只有私钥才能解密。在加密解密中,公钥加密,私钥解密。例如,表单登陆中,需要将密码发给服务器。为了安全地传输,可以将密码用公钥加密,再传送给服务器。服务器接受到加密后的密码,再用私钥解密,就可以得到真正的密码了。公钥密码体系的优点:

  • 添加新用户时只需要生成一个公钥私钥对
  • 便于从非对称系统移除用户
  • 只需要在用户私钥失信的情况下重新生成密钥
  • 非对称密钥加密可提供完整性、身份验证和不可否认性
  • 密钥分发简便易行
  • 不需要预先建立通信关联

数字签名:私匙加密,公匙解密

三、对称密钥

1、数据加密标准

  • 美国政府于1977年发布数据加密标准,DES是一种64位块密码,使用的密钥长度是56位
  • DES通过长长的一系列异或XOR运算生成密文,经过16轮加密

2、三重DES

  • 变种1:使用3个不同的密钥(K1、K2、K3)给明文加密三遍
  • 变种2:使用3个不同的密钥(K1、K2、K3),K1加密、K2解密、K1加密
  • 变种3:使用2个不同的密钥(K1、K2),K1加密、K2加密、K1加密
  • 变种4:使用2个不同的密钥(K1、K2),K1加密,K2解密、K1加密

3、国际数据加密算法IDEA

IDEA也是在64位明文块上计算的,只不过IDEA使用128位密钥,这个密钥被分解成52个16位的子密钥进行一系列计算,主要运用在PGP良好隐私的安全邮件软件包中。

4、Blowfish

Blowfish块密码是DES和IDEA的替代方案,也是在64位明文块上计算的,但是它的密钥长度是可变的,32~448,常用于SSH中。

5、Skipjack

Skipjack也是在64位明文块上计算的,它支持加密密钥托管,密钥长度80。

6、高级加密标准AES

NIST在2001年宣布,使用AES代替DES。AES在128位明文块上计算,密钥长度128、192、256,相差64。

7、对称密钥管理

  • 创建和分发对称密钥:线下分发、公钥加密、Diffe-Hellman(RSA演化来的)
  • 存储和销毁对称密钥:对员工离职后,他知道的密钥必须更换
  • 密钥托管和恢复:公平密码系统、受托加密标准

迪菲-赫尔曼密钥交换(英语:Diffie–Hellman key exchange,缩写为D-H) 是一种安全协议。它可以让双方在完全没有对方任何预先信息的条件下通过不安全信道创建起一个密钥。这个密钥可以在后续的通讯中作为对称密钥来加密通讯内容。迪菲-赫尔曼通过公共信道交换一个信息,就可以创建一个可以用于在公共信道上安全通信的共享秘密。

例子:

  1. 爱丽丝与鲍伯协定使用 p=23以及base g=5.
  2. 爱丽丝选择一个秘密整数a=6,计算A = g^{a} mod p并发送给鲍伯。
    • A = 5^{6} mod 23 = 8.
  3. 鲍伯选择一个秘密整数b=15,计算B = g^{b} mod p并发送给爱丽丝。
    • B = 5^{15} mod 23 = 19. 
  4. 爱丽丝计算s = B^{a} mod p
    • 19^{6} mod 23 = 2.
  5. 鲍伯计算s = A^{b} mod p
    • 8^{15} mod 23 = 2.

常见的对称加密算法有AES、ChaCha20、3DES、Salsa20、DES、Blowfish、IDEA、RC5、RC6、Camellia。

特点:对称加密的速度比公钥加密快很多,在很多场合都需要对称加密。

Security Authentication_第2张图片

 Type of attack:

access

modification

denial-of-service

repudiation

DAY3

Digital signature:to provided authenticity(真实性) 、integrity(完整性)、Non-repudiation(不可否认性)to eletrical documents and communicated messages.

we use private key to encrypto and use public key to decrypto.

The key is secured used PIN protected soft tokens、hard tokens、smart cards.

soft tokens is not prefer:

1.the key become static and machine dependent.

2、The key is in know file format.

private key of CA or CCA required the highest level of security

Hardware Security Module(HSM) is used for storing the Private key.

More than one person are required the signing.

HSM is housed in a strong room with video surveilance on 24*7 basis.

SUMMARIZED:

1、Each individiual has a pair of key

2、Public key of each individiual is cetificated by CA.

3、Public key of CA is cetificated by the Controller.

4、Public key of Controller is certificated by itself.

5、public key of everyone are know to all concerned and also are available on the web.

6、certification practice statement is displayed on the web site.

key generation

-True random numbers

-RSA key pair [Private/Public key]

  • 128 bits for symmetric key algorithms
  • at least 2048-bits for public key algorism

Digital signature

-Generate message digest

-Encrypting Digest using private key

-Attaching the signatures to the message

Verification of signatures

-Run the for Authentication、integrity、Non-repudiation

Digital signatures cartificate

-ITU X.509 V3

-A digital certificate is necessary for a digital signature because it can use public key to validate 

the private key that is associated with digital signature.

-digital certificate make digital signature is possible to authenticate digital information  

DAY4

Cryptography Concept:It's mean hidden word.It's splits into two:cryptography and cryptanalysis.

It's the study of mathematical techniques related to aspect of information security such as condifentiality,itegrity,authenciation,availablity,accountability,a,non-repudiation

Feistel cipher is a type of symmetric structure used in block cipher

Key length reduced from 128 to 56 bits

64 bit block length

56 bit key length

16 rounds

48 bits of key used in each round (subkey)

each S-box maps 6 bits to 4 bits

 S-DES Algorit

IP (Initial Permutation)

IP = {2, 6, 3, 1, 4, 8, 5, 7}

第二位为数字一,第六位为数字二,第三位为数字三。。。

IP-1 = {4, 1, 3, 5, 7, 2, 8, 6}

Expansion Permutation(轮函数·E扩展置换)

The expansion permutation expands its input from 32 to 48 bits, and the subkey is XORed with the result.

给出:

1101000100110100

0010001100111011

一、扩展(四位至六位,去上个四位的尾部和下个四位的首部)得到:

111010 100010 100110 101000

000100 000110 100111 110111

二、分行列

row:10☞二的零次方乘零+二的一次方乘一=2

col:1101☞二的零次方乘一+二的一次方乘零+二的二次方乘一+二的三次方乘一=13

s盒的置换:XORed异或运算

查表

Security Authentication_第3张图片

得到A=10

为1010

 P盒的置换P-box:是XORed异或运算

原理

  1. 32位作为输入
  2. 该置换把输入的每位映射到输出位,任何一位不能被映射两次,也不能被略去,映射规则如下表:
16 7 20 21 29 12 28 17
1 15 23 26 5 18 31 10
2 8 24 14 32 27 3 9
19 13 30 6 22 11 4 25

表中的数字代表原数据中此位置的数据在新数据中的位置,即原数据块的第16位放到新数据的第1位,第7位放到第2位,……依此类推,第25位放到第32位。

举例

例如十六进制10A1 0001进行P盒置换后变为8000 0886(十六进制)。

10A1 0001(十六进制)转换为32位二进制为0001 0000 1010 0001 0000 0000 0000 0001,填入表中(如下)。

0 0 0 1 0 0 0 0
1 0 1 0 0 0 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1

经P盒变换后为(原来的第16位放到输出的第1位....)

1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0
1 0 0 0 0 1 1 0

经P盒变换后二进制为1000 0000 0000 0000 0000 1000 1000 0110,转换为十六进制为8000 0886。

你可能感兴趣的:(网络安全,大数据)