Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
**/dist
**/log
**/logs
**/*.log
**/*.log
.DS_Store
.vscode
105 changes: 46 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# 华南师范大学本科毕业论文 latex 模板

SEO: 华师毕业论文模板, 华师本科毕业论文模板, 华师论文模板, latex 模板, 毕业论文模板, SCNU, SCNU 论文模板, SCNU 本科论文模板

## 使用
> 本文基于 [claviering/latex-scnu](https://github.com/claviering/latex-scnu),结合2017级论文实际写作要求修改而成。

## 目录结构

Expand All @@ -17,22 +14,40 @@ SEO: 华师毕业论文模板, 华师本科毕业论文模板, 华师论文模
├── reference 参考文献
├── state-auth 授权页面
├── thanks 致谢
├── requirements 论文要求
├── main.cls 引入各种包
└── main.tex input 各个章节, 入口文件

## 使用 Usage
## 使用指南

`make`
1. 阅读论文要求
2. 阅读本文档
3. 通读本项目内容,关注
1. 图片插入 includegraphics
2. 表格插入 table
3. 代码插入 lstlistings
4. 所有注释
4. 修改页眉
5. 写作论文
6. 加上引用,推荐使用谷歌学术导出BibTex,修改 `reference/ref.bib`
7. 参照论文要求当中的Checklist进行自查

不需要编译生成参考文献
### 编译文档
> 推荐使用命令行,因为vscode的workshop recipes可能会导致引用无效

`make pdf`
生成完整文档:`make`

## 字体
不生成参考文献:`make pdf`

默认就是宋体
### 页眉设置

## 字号大小
main.cls 78行

`\newcommand{\thesistitlefancyhead}{论文题目设置为页眉} % 定义论文题目为页眉`

### 字号设置
根据要求,部分中文为黑体。
中文默认就是宋体,英文默认是Times New Roman。

```tex
{\zihao{-6}小六}
Expand All @@ -45,11 +60,22 @@ SEO: 华师毕业论文模板, 华师本科毕业论文模板, 华师论文模
{\zihao{2}二号}
{\zihao{-1}小一}
{\zihao{1}一号}
{\heiti 黑体}
```

## 论文写作要求

- 严格的学术规范,论文规范,
### 封面

正式论文装订最后统一使用学校发的封面,打印的封面仅仅给答辩老师看的,那种封面好看就用那种,无所谓。

```tex
\input{cover/image} % 图片封面
\input{cover/index} % 文字封面
```

## 论文写作建议

- **严格的学术规范,论文规范**
- 标题。
- 图表需要自己做自己做。
- 内容思考过。
Expand All @@ -67,60 +93,21 @@ SEO: 华师毕业论文模板, 华师本科毕业论文模板, 华师论文模
- 有什么难度?有什么工作量?。
- 论文里面图要有意义。


## 论文答辩

- 论文答辩5页ppt。
- 12个人,一个上午。
- 为什么这么做。
- 有思想。
- 答辩的时候主要体现:工作量、工作态度、学术规范等。
- 不需要原创性!是自己的工作即可。比如,多写代码。
- 毕业论文一大忌就是:没有突出自己的工作!你们一定要明确表明自己想做什么,怎么分析、设计,最终做了什么。

## 命令说明

```tex
% 设置 1.5 倍行距
\usepackage{setspace}
\begin{spacing}{1.5}
\end{spacing}
```

## 添加空白页

正文前的空白页不加底部页面 `\afterpage{\blankpage} `

正文中的空白页,添加底部页面 `\afterpage{\null\newpage}`

## 封面

正式论文装订最后统一使用学校发的封面,打印的封面仅仅给答辩老师看的,那种封面好看就用那种,无所谓。

```tex
\input{cover/image} % 图片封面
\input{cover/index} % 文字封面
```

## 排版细节
### 论文排版

- 一个章节文字要多,显得有话可说
- 章节里注意分段,一个段落不能太长,注意行数
- 章节排版要新开一页,并且要在单数页
- 表格要有表头
- 图片要有说明

## 文献

文章中引用到的文献才写到参考文献中

## 页眉设置

main.cls 78行

`\newcommand{\thesistitlefancyhead}{论文题目设置为页眉} % 定义论文题目为页眉`
### 论文答辩

</center>
- 为什么这么做。
- 有思想。
- 答辩的时候主要体现:工作量、工作态度、学术规范等。
- 不需要原创性!是自己的工作即可。比如,多写代码。
- 毕业论文一大忌就是:没有突出自己的工作!你们一定要明确表明自己想做什么,怎么分析、设计,最终做了什么。

## 参考

Expand Down
12 changes: 8 additions & 4 deletions abstract/abstract-en.tex
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
\begin{center}
{\zihao{-2}\bfseries THESIS NAME}
\\ \hspace*{\fill} \\
\addcontentsline{toc}{section}{Abstract}
\zihao{-2}
Abstract
\zihao{4} Abstract
\end{center}

\zihao{-4}
\ \\
\zihao{5}
A replay attack is a form of network attack in which a valid data transmission is maliciously or fraudulently repeated or delayed. It is mainly used in the identity authentication process and destroys the correctness of authentication. In this paper, I analyze the replay attacks that exist in the zero round-trip time protocol used in the transport layer protocol. Programming to implement a simple transport layer protocol, then I reproduce the relevant replay attacks by programming and implement four methods to resist the replay attack protocol. The methods are as follows. First, examine whether the Ticker sent by the client to the zero round trip expires. Second, examine whether the Ticker sent by the client to the zero round trip is used. Third, make the server only accept zero rounds of idempotent requests. Fourth, add an Early-Data request header to inform the server that this request is an early data request, allowing the server to determine whether to accept early data based on actual conditions. After testing and analysis, I conclude that the combination of the first, the second and the fourth method can achieve the best effect, ensuring that the server can process the early data normally without being affected by the zero round-trip time replay attack.
\ \\
\textbf{Keywords: }0-RTT, TLS 1.3, Early Data,\ Replay Attacks
\ \\
\zihao{-4}
\textbf{Keywords:}\ \ 0-RTT, TLS 1.3, Early Data,\ Replay Attacks
\newpage
11 changes: 8 additions & 3 deletions abstract/abstract-zh-CN.tex
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
\setcounter{page}{1}
\pagenumbering{Roman}
\begin{center}
{\zihao{-2}\heiti\bfseries 论文标题}
\\ \hspace*{\fill} \\
\addcontentsline{toc}{section}{摘要}
\zihao{-2} \bfseries 摘\quad 要
\zihao{4} \bfseries 摘\quad 要
\end{center}

\zihao{-4}
\ \\
\zihao{5}
分析传输层协议中使用的零轮往返时长协议存在的重放攻击,编程实现简单传输层协议,重现相关重放攻击,并分别实现四种方法抵抗重放攻击。方法一:检查客户端发送零轮往返的 Ticker 是否过期。方法二:检查客户端发送零轮往返的 Ticker 是否被使用。方法三:服务器只接受零轮往返幂等性的请求。方法四:添加 Early-Data 请求头,告知服务器此请求是早期数据请求,服务器根据实际情况判断是否接受早期数据。进过测试分析得出,方法一、方法二和方法四组合能达到最优效果,保证服务器能正常处理早期数据的同时不受零轮往返时长重放攻击的影响。
\ \\
\textbf{关键词: }传输层协议;零轮往返时长;早期数据;重放攻击
\ \\
\zihao{-4}
{\heiti \bfseries 关键词:}\ \ 传输层协议;零轮往返时长;早期数据;重放攻击

\newpage
1 change: 0 additions & 1 deletion body/AEAD.tex
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ \subsection{对称加密算法}
ChaCha20-Poly1305 避开了现有发现的所有安全漏洞和攻击;
ChaCha20-Poly1305 针对移动端设备大量使用的ARM芯片做了优化,能够充分利用 ARM 向量指令,在移动设备上加解密速度更快、更省电;Poly1305 输出只有 16字节,更加节省带宽

\afterpage{\null\newpage}
\newpage
7 changes: 4 additions & 3 deletions body/TLS1.3.tex
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ \section{实现简单传输层协议}

本次开发讲使用 HTML5、CSS3、JavaScript 等基本编程语言。HTML5 为我提供不少的浏览器接口,localStorage,Cookie 等存储方式,WebSocket 协议能使服务器主动推送消息到客户端,完成 TLS 1.3 握手功能。HTML5 为网页提供最基本骨架,页面的元素,让浏览器应用开发更加多样化,功能更强大的技术。各大浏览器支持情况良好。CSS3 作为 HTML5 的化妆师,提供页面美化和页面布局,样式化和排版前端网页,例如控制页面字体大小、颜色、间距等。CSS3选择器需要结合 HTML5 使用,在 HTML5 元素中使用对应的 CSS 选择器。JavaScript 是一种面向对象的动态语言,提供浏览器和用户进行页面交互的操作,是开发中的核心技术,在编程语言中排行前10。比较轻量级,插入到 HTML5 页面中,可以通过大多数浏览器解析执行。

服务器开发使用 Node.js,实际上它是对 Google Chrome V8 引擎进行了封装,它主要用于创建快速的、可扩展的网络应用。 Node.js 采用事件驱动和非阻塞I/O模型,使其变得轻量和高效。对比解析运行在 Chrome 浏览器上的 JavaScript 代码,Chrome 浏览器就是 JavaScript 代码的解析器,当 JavaScript 代码运行在服务器上时,Node.js 就是 JavaScript 代码的解析器,存在于服务器端的 JavaScript 代码由 Node.js 来解析和运行。JavaScript 解析器用于提供 JavaScript 代码运行的一种环境,浏览器是 JavaScript 运行的一种环境,不同的浏览器有不同的解析引擎,浏览器为 JavaScript 提供了操作文档对象模型和浏览器窗口对象等的接口。Node.js 是一个基于 Chrome V8引擎的 JavaScript 运行环境,提供了操作系统文件、创建 HTTP 服务、 创建 TCP/UDP 服务等的接口,Node.js 的包管理器 npm,是全球最大的开源库生态系统。

\subsection{功能介绍}

实现握手协议,记录层协议。使用 WebSocket 交换客户端和服务器端的密钥参数,主要实现 AEAD 算法: AES-256-GCM, ChaCha20-Poly1305。HKDF\cite{RFC5869} 密钥导出算法。编程实现 FRC8446 中客户端和服务器端的状态机。完整的一轮往返握手和零轮往返,一轮往返握手为之后建立零轮往返建立基础,用于实现重放攻击。
Expand All @@ -57,4 +55,7 @@ \section{实现简单传输层协议}
\item extensions: 拓展。TLS 1.3 版本中必须包含 supported\_versions 扩展
\end{enumerate}

服务器参数和认证消息这里不展开详细说明。Certificate: 将证书链发送给对方,当约定的密钥交换方法是用证书进行认证的时候,服务器就必须发送 Certificate 消息,当且仅当客户端通过发送 CertificateRequest 消息请求认证客户端时,客户端必须发送 Certificate 消息,当客户端没有合适的证书时,必须发送不含证书的 Certificate 消息。Certificate Verify: 此消息用于证明发送方拥有其证书对应的私钥,必须在 Certificate 消息之后立即发送,并且紧接着在 Finished 消息之前。Finished: 提供握手和密钥的身份验证,Finished 消息的接受者必须验证内容是否正确,如果不正确,必须使用 decrypt\_error alert 消息终止连接。End of Early Data: 如果服务器在 EncryptedExtensions 中发送了 early\_data 扩展,则客户端必须在收到服务器的 Finished 消息后发送 EndOfEarlyData 消息。
服务器参数和认证消息这里不展开详细说明。Certificate: 将证书链发送给对方,当约定的密钥交换方法是用证书进行认证的时候,服务器就必须发送 Certificate 消息,当且仅当客户端通过发送 CertificateRequest 消息请求认证客户端时,客户端必须发送 Certificate 消息,当客户端没有合适的证书时,必须发送不含证书的 Certificate 消息。Certificate Verify: 此消息用于证明发送方拥有其证书对应的私钥,必须在 Certificate 消息之后立即发送,并且紧接着在 Finished 消息之前。Finished: 提供握手和密钥的身份验证,Finished 消息的接受者必须验证内容是否正确,如果不正确,必须使用 decrypt\_error alert 消息终止连接。End of Early Data: 如果服务器在 EncryptedExtensions 中发送了 early\_data 扩展,则客户端必须在收到服务器的 Finished 消息后发送 EndOfEarlyData 消息。

\input{body/key/index}
\input{body/AEAD}
1 change: 0 additions & 1 deletion body/anti-replay.tex
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ \subsection{防御零轮往返时长协议重放攻击}

通过共享数据库可以防止第二种攻击,以保证集群中的系统最多接受一次 0-RTT 数据,最多响应一次。使用 Ticker 共享,多个服务器使用同一个 Redis 数据库保存 Ticker,维护 Ticker 在分布式系统的的唯一性,群集中的服务器都将生成的 Ticker 保存到公共 Redis 数据库,统一维护 Ticker 唯一性和有效期。当集群中某一台服务器接收到 0-RTT 的时候,首先去查询数据库对应的 Ticker,如果是第一次发送并非重放攻击,并且此 Ticker 没有过期,下一步检查 Binder 的正确性。当攻击者重放 0-RTT 的时候,负载均衡会将请求分发都没个后台服务,当其中一个请求查询 Ticker 时候,可以设置锁定数据库,防止重复读取合法的 Ticker。

\afterpage{\null\newpage}

% 设置 max\_early\_data\_size 大小,以允许客户端发送指定大小的 early data
% max\_early\_data\_size:使用此票证时允许客户端发送的最大0-RTT数据量(以字节为单位)。 仅计算应用数据有效载荷(即,明文但不填充或内部内容类型字节)。 接收超过max\_early\_data\_size字节的0-RTT数据的服务器应该使用“unexpected\_message”警报终止连接。
27 changes: 20 additions & 7 deletions body/index.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
\input{body/introduction}
\input{body/TLS1.3}
\input{body/key/index}
\input{body/AEAD}
\input{body/analyze-0-RTT}
\input{body/test-result}
\input{body/conclusion}
% 每一章都要重置图标计数
\setcounter{figure}{0}
\setcounter{table}{0}
\include{body/introduction}

\setcounter{figure}{0}
\setcounter{table}{0}
\include{body/TLS1.3}

\setcounter{figure}{0}
\setcounter{table}{0}
\include{body/analyze-0-RTT}

\setcounter{figure}{0}
\setcounter{table}{0}
\include{body/test-result}

\setcounter{figure}{0}
\setcounter{table}{0}
\include{body/conclusion}
Loading