High-performance encryption/decryption API using Worker Threads for parallel processing.
npm install
npm run build
npm run startcurl -X POST http://localhost:3000/crypto/encrypt \
-H "Content-Type: application/json" \
-d '{
"data": ["Hello World", "Secret Message", "Another Text"],
"key": "mySecretKey123"
}'curl -X POST http://localhost:3000/crypto/decrypt \
-H "Content-Type: application/json" \
-d '{
"encryptedData": ["<encrypted-string-1>", "<encrypted-string-2>"],
"key": "mySecretKey123"
}'- Parallel Processing: Utilizes all available CPU cores
- Worker Threads: Each CPU core runs independent encryption/decryption tasks
- AES-256-CBC: Secure encryption algorithm
- High Throughput: Processes multiple items simultaneously
- Performance Metrics: Returns processing time and thread count
The service automatically:
- Detects the number of available CPU cores
- Splits input data into chunks (one per CPU core)
- Spawns worker threads for parallel processing
- Aggregates results from all threads
This approach maximizes CPU utilization and throughput for bulk encryption/decryption operations.