All Projects → ishuibo → rsa-encrypt-body-spring-boot

ishuibo / rsa-encrypt-body-spring-boot

Licence: Apache-2.0 license
Spring Boot 接口请求参数自动加解密

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to rsa-encrypt-body-spring-boot

Rsactftool
RSA attack tool (mainly for ctf) - retreive private key from weak public key and/or uncipher data
Stars: ✭ 3,163 (+2828.7%)
Mutual labels:  rsa
Jsrsasign
The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES JSON Web Signature/Token in pure JavaScript.
Stars: ✭ 2,760 (+2455.56%)
Mutual labels:  rsa
pandorabox
基于非对称加密(RSA)的私密信息传递工具,数据由本地客户端进行加密、解密操作。
Stars: ✭ 18 (-83.33%)
Mutual labels:  rsa
Putty Cac
Windows Secure Shell Client With Support For Smart Cards & Certificates
Stars: ✭ 192 (+77.78%)
Mutual labels:  rsa
Rsautil
.NET Core RSA algorithm using the help tool.It supports data encryption, decryption, signature and verification signature.It supports three key formats, namely: xml, pkcs1, pkcs8.It also supports key conversion for these three formats.Last also support pem formatting.
Stars: ✭ 218 (+101.85%)
Mutual labels:  rsa
Illustrated Tls
The Illustrated TLS Connection: Every byte explained
Stars: ✭ 2,751 (+2447.22%)
Mutual labels:  rsa
Datash
Send and Receive files directly from your browser with end-to-end encryption
Stars: ✭ 178 (+64.81%)
Mutual labels:  rsa
optiga-trust-m
OPTIGA™ Trust M Software Framework
Stars: ✭ 86 (-20.37%)
Mutual labels:  rsa
Ctf Crypto
Contains tools for solving RSA and other crypto problems in CTFs.
Stars: ✭ 221 (+104.63%)
Mutual labels:  rsa
cosign
Cooperative RSA signing
Stars: ✭ 25 (-76.85%)
Mutual labels:  rsa
Encrypt Body Spring Boot Starter
(停止维护,替代品搜索:https://github.com/search?l=Java&q=encrypt&type=Repositories )SpringBoot控制器统一的响应体加密与请求体解密的注解处理方式,支持MD5/SHA/AES/DES/RSA
Stars: ✭ 198 (+83.33%)
Mutual labels:  rsa
Auth Jwt
A demo to learn JWT by reverse engineering
Stars: ✭ 208 (+92.59%)
Mutual labels:  rsa
crypto.js
base on crypto module
Stars: ✭ 13 (-87.96%)
Mutual labels:  rsa
Easyrsa
Simple and Secure Wrapper for phpseclib
Stars: ✭ 183 (+69.44%)
Mutual labels:  rsa
enigma
A fast, native, cryptographic engine for the web
Stars: ✭ 101 (-6.48%)
Mutual labels:  rsa
Cry
Cross platform PoC ransomware written in Go
Stars: ✭ 179 (+65.74%)
Mutual labels:  rsa
Network
C# Network Library
Stars: ✭ 237 (+119.44%)
Mutual labels:  rsa
cryptotools
No description or website provided.
Stars: ✭ 182 (+68.52%)
Mutual labels:  rsa
encryption
A simple wrapper for the OpenSSL Cipher library for Ruby and Rails applications. Distributed as a Gem through Rubygems.
Stars: ✭ 28 (-74.07%)
Mutual labels:  rsa
accumulator
Cryptographic accumulators in Rust.
Stars: ✭ 115 (+6.48%)
Mutual labels:  rsa

1.介绍

rsa-encrypt-body-spring-boot
Spring Boot接口加密,可以对返回值、参数值通过注解的方式自动加解密。

2.使用方法

Apache Maven

<dependency>
  <groupId>cn.shuibo</groupId>
  <artifactId>rsa-encrypt-body-spring-boot</artifactId>
  <version>1.0.2.RELEASE</version>
</dependency>

Gradle Groovy DSL

implementation 'cn.shuibo:rsa-encrypt-body-spring-boot:1.0.1.RELEASE'

Gradle Kotlin DSLScala SBTApache IvyGroovy GrapeLeiningenApache BuildrMaven Central BadgePURLBazel方式请阅读Spring Boot接口RSA自动加解密

  • 以Maven为例,在pom.xml中引入依赖
<dependency>
    <groupId>cn.shuibo</groupId>
    <artifactId>rsa-encrypt-body-spring-boot</artifactId>
    <version>1.0.2.RELEASE</version>
</dependency>
  • 启动类Application中添加@EnableSecurity注解
@SpringBootApplication
@EnableSecurity
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}
  • 在application.yml或者application.properties中添加RSA公钥及私钥
rsa:
  encrypt:
    open: true # 是否开启加密 true  or  false
    showLog: true # 是否打印加解密log true  or  false
    timestampCheck: true # 是否开启时间戳检查 ture or false
    publicKey: # RSA公钥
    privateKey: # RSA私钥
  • 对返回值进行加密
@Encrypt
@GetMapping("/encryption")
public TestBean encryption(){
    TestBean testBean = new TestBean();
    testBean.setName("shuibo.cn");
    testBean.setAge(18);
    return testBean;
}
  • 对传过来的加密参数解密
@Decrypt
@PostMapping("/decryption")
public String Decryption(@RequestBody TestBean testBean){
    return testBean.toString();
}
  • @Decrypt
public @interface Decrypt{

    /**
     * 请求参数一定要是加密内容
     */
    boolean required() default false;

    /**
     * 请求数据时间戳校验时间差
     * 超过(当前时间-指定时间)的数据认定为伪造
     * 注意应用程序需要捕获 {@link cn.shuibo.exception.EncryptRequestException} 异常
     */
    long timeout() default 3000;
}

3.About author

码农届首家互娱自媒体

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].