Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattwelke/encrypt-and-decrypt-example
https://github.com/mattwelke/encrypt-and-decrypt-example
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mattwelke/encrypt-and-decrypt-example
- Owner: mattwelke
- Created: 2022-06-08T01:01:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-15T18:06:01.000Z (over 2 years ago)
- Last Synced: 2024-10-14T02:24:19.434Z (3 months ago)
- Language: Java
- Size: 84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# encrypt-and-decrypt-example
Testing out encrypting and decrypting data. Encryption code copied from https://www.baeldung.com/java-aes-encryption-decryption. Integrated into Micronaut application from Micronaut Launch generated June 7, 2022.
Goal is to have an application that can encrypt data for it to be transmitted to another application, with the other application receiving it and decrypting it back to its original form.
It is not a requirement that the application receiving it be able to receive it long in the future. It is understandable that the secrets used for encrypting and decrypting data would need to be rotated over time, so the idea is that a secret rotation will result in very little of the transmitted data being undecryptable, and that's okay.
The same input to the encrypt step must always produce the same output from the decrypt step, given the same secrets configured.
## encrypting
```bash
curl --request POST \
--url http://localhost:8080/encrypt \
--header 'Content-Type: text/plain' \
--data abc123
```## decrypting
Request body is the result of encrypting and Base64-encoding the string "abc123".
```base
curl --request POST \
--url http://localhost:8080/decrypt \
--header 'Content-Type: text/plain' \
--data 'IObNzU1ocw8PCAy382jN+Q=='
```