W3C XML Encryption implementation for node.js (http://www.w3.org/TR/xmlenc-core/)
Usage
npm install xml-encryption
encrypt
var xmlenc = ; var options = rsa_pub: fs pem: fs encryptionAlgorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' keyEncryptionAlgorighm: 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p'; xmlenc
Result:
MIIEDzCCAveg... base64 cert... q3uaLvlAUo= sGH0hhzkjmLWYYY0gyQMampDM... encrypted symmetric key ...gewHMbtZafk1MHh9A== V3Vb1vDl055Lp92zvK..... encrypted content.... kNzP6xTu7/L9EMAeU
decrypt
var options = key: fs; xmlenc
Supported algorithms
Currently the library supports:
-
EncryptedKey to transport symmetric key using:
-
EncryptedData using:
However, you can fork and implement your own algorithm. The code supports adding more algorithms easily
Issue Reporting
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Author
License
This project is licensed under the MIT license. See the LICENSE file for more info.