> For the complete documentation index, see [llms.txt](https://potoyang.gitbook.io/spring-in-action-v5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://potoyang.gitbook.io/spring-in-action-v5/di-14-zhang-pei-zhi-guan-li/14.5-wei-pei-zhi-de-shu-xing-jia-mi.md).

# 14.5 为配置的属性加密

Config Server 提供的配置大多数是不需要加密的。但一些敏感信息（如密码）最好在后端存储库中以加密的形式存储。

Config Server 提供两种方式处理加密配置：

* 在 Git 存储的配置文件中，写入加密值
* 使用 HashiCorp 的保险库作为 Config Server 的后端存储，以代替 Git。

让我们看看 Config Server 为保持配置属性的机密性，是如何使用这两种方式的。我们先看一下将加密属性写入 Git 后端存储库。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://potoyang.gitbook.io/spring-in-action-v5/di-14-zhang-pei-zhi-guan-li/14.5-wei-pei-zhi-de-shu-xing-jia-mi.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.
