# encrypt-body-spring-boot-starter **Repository Path**: dancer4code/encrypt-body-spring-boot-starter ## Basic Information - **Project Name**: encrypt-body-spring-boot-starter - **Description**: SpringBoot控制器统一的响应体编码/加密与请求体解密的注解处理方式,支持MD5/SHA/AES/DES/RSA - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 147 - **Created**: 2020-12-21 - **Last Updated**: 2020-12-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [简体中文](./README.md) | English > This English document is translated by Google Translate. If you are willing to assist us with the documentation, please submit the relevant Pull Request. ## Introduction `encrypt-body-spring-boot-starter` it is a unified processing method for response body encryption and request body decryption of SpringBoot controller, and supports MD5/SHA/AES/DES/RSA. [![](https://img.shields.io/github/release/Licoy/encrypt-body-spring-boot-starter.svg)]() [![](https://img.shields.io/github/issues/Licoy/encrypt-body-spring-boot-starter.svg)]() [![](https://img.shields.io/github/issues-pr/Licoy/encrypt-body-spring-boot-starter.svg)]() [![](https://img.shields.io/badge/author-Licoy-ff69b4.svg)]() ## Encryption and decryption support - There are ways to encrypt: - - [x] MD5 - - [x] SHA-224 / 256 / 384 / 512 - - [x] AES - - [x] DES - - [ ] RSA - There are ways to decrypt: - - [x] AES - - [x] DES - - [ ] RSA ## Usage method - Introducing dependencies in `pom.xml`: ```xml cn.licoy encrypt-body-spring-boot-starter 1.0.3.RELEASE ``` - Add the @EnableEncryptBody annotation to the `Application` class corresponding to the project, for example: ```java @EnableEncryptBody @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } ``` - Parameter configuration Configure the parameters in the project's `application.yml` or `application.properties` file, for example: ```yaml encrypt: body: aes-key: 12345678 #AES encryption key des-key: 12345678 #DES encryption key ``` - Encrypt the controller response body ```java @Controller @RequestMapping("/test") public class TestController { @GetMapping @ResponseBody @EncryptBody(value = EncryptBodyMethod.AES) public String test(){ return "hello world"; } } ``` Or use `@RestController` to encrypt the method response body of the entire controller: ```java @RestController @EncryptBody @RequestMapping("/test") public class TestController { @GetMapping public String test(){ return "hello world"; } } ``` ## Annotated list - [Encrypted annotation list](https://github.com/Licoy/encrypt-body-spring-boot-starter/wiki/加密注解一览表) - [Decryption annotation list](https://github.com/Licoy/encrypt-body-spring-boot-starter/wiki/解密注解一览表) ## Discuss - Author blog:[https://www.licoy.cn](https://www.licoy.cn) ## Open source agreement [Apache 2.0](/LICENSE)