Encryo is a lightweight and efficient encryption and decryption microservice built with Rust. It uses the AES-GCM encryption standard for secure and high-performance data handling. The service exposes two simple endpoints for encryption and decryption of data, designed to be easily deployable in Docker or Kubernetes environments.
- High Performance: Built with Rust for low-latency and efficient memory usage.
- Secure Encryption: Uses AES-GCM with strong security guarantees.
- Simple API: RESTful endpoints for easy integration.
- Scalable: Docker-ready and Kubernetes-compatible.
- Rust 1.72 or higher
- Docker (optional, for containerized deployment)
- Cargo (Rust's package manager)
POST /encrypt
Encrypts the given plaintext data.
Request Body:
{
"data": "example@gmail.com"
}
Response:
{
"encrypted": "Base64-encrypted-string"
}
POST /decrypt
Decrypts the provided encrypted data.
Request Body:
{
"encrypted": "Base64-encrypted-string"
}
Response:
{
"data": "example@gmail.com"
}
-
Clone the repository:
git clone https://github.com/your-username/encryo-service.git cd encryo-service
-
Build and run the service:
cargo run --release
-
The service will be available at
http://localhost:3030
.
-
Build the Docker image:
docker build -t encryo-service .
-
Run the container:
docker run -p 3030:3030 encryo-service
Variable | Description | Default |
---|---|---|
ENCRYPTION_KEY |
Encryption key for AES-GCM (32 bytes) | Randomly generated |
- Create a
deployment.yaml
file:
apiVersion: apps/v1
kind: Deployment
metadata:
name: encryo-service
spec:
replicas: 3
selector:
matchLabels:
app: encryo-service
template:
metadata:
labels:
app: encryo-service
spec:
containers:
- name: encryo-service
image: your-dockerhub-username/encryo-service:latest
ports:
- containerPort: 3030
- Apply the deployment:
kubectl apply -f deployment.yaml
This project is licensed under the MIT License.
Contributions are welcome! Please submit a pull request or open an issue if you find a bug or have a feature request.