# 小結

這一章主要介紹了如：CSRF 攻擊、XSS 攻擊、SQL 注入攻擊等一些 Web 應用中典型的攻擊手法，它們都是由於應用對使用者的輸入沒有很好的過濾引起的，所以除了介紹攻擊的方法外，我們也介紹了了如何有效的進行資料過濾，以防止這些攻擊的發生的方法。然後針對日異嚴重的密碼洩漏事件，介紹了在設計 Web 應用中可採用的從基本到專家的加密方案。最後針對敏感資料的加解密簡要介紹了，Go 語言提供三種對稱加密演算法：base64、aes 和 des 的實現。

編寫這一章的目的是希望讀者能夠在意識裡面加強安全概念，在編寫 Web 應用的時候多留心一點，以使我們編寫的 Web 應用能遠離黑客們的攻擊。Go 語言在支援防攻擊方面已經提供大量的工具套件，我們可以充分的利用這些套件來做出一個安全的 Web 應用。

## links

* [目錄](https://github.com/doggy8088/build-web-application-with-golang-zhtw/tree/4cbbaa31bdfc3678915eb91f23db2f1bad554a20/preface.md)
* 上一節: [加密和解密資料](https://willh.gitbook.io/build-web-application-with-golang-zhtw/09.0/09.6)
* 下一節: [國際化和本地化](https://willh.gitbook.io/build-web-application-with-golang-zhtw/10.0)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://willh.gitbook.io/build-web-application-with-golang-zhtw/09.0/09.7.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
