Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boo1ean/express-decrypt
Express middleware for request body decrypting
https://github.com/boo1ean/express-decrypt
Last synced: 30 days ago
JSON representation
Express middleware for request body decrypting
- Host: GitHub
- URL: https://github.com/boo1ean/express-decrypt
- Owner: boo1ean
- Created: 2015-03-30T12:23:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-30T12:24:11.000Z (over 9 years ago)
- Last Synced: 2024-04-14T18:41:58.013Z (7 months ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## express-decrypt
Express middleware for decryption of base64-encoded RSA-encrypted request bodies
## Installations
```
npm install express-decrypt
```## Usage
```js
var fs = require('fs');
var app = require('express')();
var expressDecrypt = require('express-decrypt');app.use(expressDecrypt({
privateKey: fs.readFileSync('private_key.pem').toString()
}));app.all('*', function (req, res) {
var jsonData = JSON.parse(req.body);
res.json(jsonData);
});app.listen(3000);
```## Options
`privateKey` - private key pem string
`padding` - see [ursa](https://github.com/quartzjer/ursa#constants)## License
MIT