TCP-IP详解:ESP(IPSec Encapsulating Security Payload)

ESP(IPSec Encapsulating Security Payload)

ESP相比AH来讲,拥有我们想要的加密功能,协议会通过加密算法将数据和Key将数据进行组合,转换成加密格式,然后送给目的端,先来看下几个比较重要的域。

1. ESP Header : 主要是包括SPI和Seq number,放在加密数据之前

2. ESP Trailer:被放置在加密数据之后,包括一个填充区域和填充长度以及一个Next Header, 这个地方比较特殊,ESP header中没有Next Header放在Trailer中

3. ESP Authentication Data : 必须是32bit的整数倍,是在前面个字段基础上计算的出来的完整性校验值ICV。

ESP的数据封装格式如下:

传输模式的ESP数据封装:

1. 原始的IPV4数据包IP header 中,proto是TCP,指向下一个的TCP header

2. 新的IPV4数据包,可以看到IP Header的proto为ESP,紧接着是ESP的SPI Seq,然后是加密的TCP header和Payload,后面就是ESP trailer

3. 在后面是ICV,验证整个数据包

隧道模式的ESP数据封装

1.原始的IPV4数据包IP header 中,proto是TCP,指向下一个的TCP header

2.新的IP header proto为ESP,然后ESP的trailer的Next Head为整个加密数据的IP头


ESP在不同模式下的认证和传输区域

1.传输模式下,红色区域便是加密区,TCP和载荷数据以及ESP尾,黄色区域是验证区包括:ESP和TCP,载荷数据和ESP尾。这个地方IP Header是不被加密和验证的。


2.隧道模式下的认证和传输区域

红色区域是加密区域,整个数据包加ESP尾, 黄色区域是验证区域,这些区域内的数据是不能被修改的。


ESP数据包发送

1.使用分组的相应选择符(目的IP地址、端口、传输协议等)查找安全策略数据库(SPD)获取策略,如分组需要IPSec处理,且其SA已建立,则与选择符相匹配的SPD项将指向安全关联数据库中的相应SA,否则则使用IKE建立SA。
2.生成或增加序列号
3.加密分组,SA指明加密算法,一般采用对称密码算法
4.计算完整性校验值

ESP数据接收

1.若IP分组分片,先重组
2.使用目的IP地址、IPSec协议、SPI进入SAD索引SA,如果查找失败,则丢弃分组
3.使用分组的选择符进入SPD中查找与之匹配的策略,根据策略检查该分组是否满足IPSec处理要求
4.检查抗重播功能
5.如SA指定需要认证,则检查数据完整性
6.解密


  • 11
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
Network Security: Private Communication in a Public World, Second Edition By Charlie Kaufman, Radia Perlman, Mike Speciner ............................................... Publisher: Prentice Hall Pub Date: April 22, 2002 Print ISBN-10: 0-13-046019-2 Print ISBN-13: 978-0-13-046019-6 Web ISBN-10: 0-13-715588-3 Web ISBN-13: 978-0-13-715588-0 Pages: 752 Copyright The Radia Perlman Series in Computer Networking and Security Acknowledgments Chapter 1. Introduction Section 1.1. Roadmap to the Book Section 1.2. What Type of Book Is This? Section 1.3. Terminology Section 1.4. Notation Section 1.5. Primer on Networking Section 1.6. Active vs. Passive Attacks Section 1.7. Layers and Cryptography Section 1.8. Authorization Section 1.9. Tempest Section 1.10. Key Escrow for Law Enforcement Section 1.11. Key Escrow for Careless Users Section 1.12. Viruses, Worms, Trojan Horses Section 1.13. The Multi-Level Model of Security Section 1.14. Legal Issues Part 1: Cryptography Chapter 2. Introduction to Cryptography Section 2.1. What Is Cryptography? Section 2.2. Breaking an Encryption Scheme Section 2.3. Types of Cryptographic Functions Section 2.4. Secret Key Cryptography Section 2.5. Public Key Cryptography Section 2.6. Hash Algorithms Section 2.7. Homework Chapter 3. Secret Key Cryptography Section 3.1. Introduction Section 3.2. Generic Block Encryption Section 3.3. Data Encryption Standard (DES) Section 3.4. International Data Encryption Algorithm (IDEA) Section 3.5. Advanced Encryption Standard (AES) Section 3.6. RC4 Section 3.7. Homework Chapter 4. Modes of Operation Section 4.1. Introduction Section 4.2. Encry
IPSec(IP Security)协议套件是用于保护IP通信的一组协议和算法。它由以下几个主要组成部分组成: 1. 认证协议: - AH(Authentication Header):提供数据的完整性验证和防止数据篡改的功能,但不提供数据的加密。 2. 加密协议: - ESPEncapsulating Security Payload):提供对IP数据包进行加密、认证和完整性保护的功能。 - IKE(Internet Key Exchange):用于自动化密钥交换和建立安全关联的协议。 3. 密钥管理协议: - ISAKMP(Internet Security Association and Key Management Protocol):用于建立和管理IPSec安全关联,提供了密钥交换和管理的功能。 4. 加密算法: - AES(Advanced Encryption Standard):对称加密算法,目前广泛使用的加密算法之一。 - 3DES(Triple Data Encryption Standard):对称加密算法,较为传统的加密算法。 - DES(Data Encryption Standard):对称加密算法,已经较少使用。 5. 认证算法: - HMAC(Hash-based Message Authentication Code):基于哈希函数的认证算法。 - MD5(Message Digest Algorithm 5):哈希函数,用于数据完整性验证,但已经不推荐使用。 - SHA(Secure Hash Algorithm):哈希函数,用于数据完整性验证,SHA-1、SHA-256等是常用的SHA算法。 IPSec协议套件的具体使用取决于安全需求和配置。通常,通过组合和配置上述协议、算法和参数,可以实现对IP通信的加密、认证和完整性保护。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值