ReflectiveCipher is a Reflection Encrypt Library forked base on Reflcypt. The main focus of this project is adding new features and patches while also keeping up to date with the original project
library's default key-algorithm isPBKDF2WithHmacSHA256
In your security field, add the code below
public class Secret {
@SecurityField // encrypt and decrypt this field.
private String field;
@EncryptParams // encrypt 'topSecret' parameter
public void vulnerableMethod(@SecurityParam String topSecret) {
// ...
}
@DecryptReturns // decrypt and return 'NonSecret' object
public NonSecret info() {
// ...
}
}
Assign field to encrypt or decrypt
- support types:
- String
- byte[] or Byte[]
Assign parameter to encrypt or decrypt
- support types:
- String
- byte[] or Byte[]
Encrypt argument, encrypt all field in argument
- useful in JPA Repository.
- ex)
.save()
- when entity save, will encrypt
- ex)
Decrypt argument, decrypt all field in argument
Encrypt return object
Decrypt return object
- useful in JPA Repository
- when method call from JPA Repository, decrypt entity and return
Springboot properties prefix is cipher
Set cipher-algorithm such as 'AES/CBC/PKCS5Padding'
- Must be choose in Java Security Standard Algorithm Name
- The class is Cipher
Set secret-key
Set hash value
Set Initialization Vector value
- Length is must be 16 bytes long
It adheres to Java's standard conventions, it's flexible enough for many variations, and I'm sure you can improve and add more features to the API in an easy-to-use way, so feel free to post ideas, issues, and pull requests.
ReflectiveCipher is available under the MIT License.
- 이승민 (Eric Lee) - CNS 3기 백엔드팀