{"id":15046617,"url":"https://github.com/auth0/node-xml-encryption","last_synced_at":"2025-05-15T07:05:24.615Z","repository":{"id":8046768,"uuid":"9457500","full_name":"auth0/node-xml-encryption","owner":"auth0","description":"W3C XML Encryption implementation for node.js (http://www.w3.org/TR/xmlenc-core/)","archived":false,"fork":false,"pushed_at":"2025-01-21T14:33:27.000Z","size":237,"stargazers_count":37,"open_issues_count":15,"forks_count":58,"subscribers_count":82,"default_branch":"master","last_synced_at":"2025-05-07T13:34:42.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auth0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-15T20:24:35.000Z","updated_at":"2025-01-21T14:32:16.000Z","dependencies_parsed_at":"2024-06-18T12:42:16.290Z","dependency_job_id":"392fa310-a741-435b-942e-1a224152b736","html_url":"https://github.com/auth0/node-xml-encryption","commit_stats":{"total_commits":116,"total_committers":31,"mean_commits":"3.7419354838709675","dds":0.7844827586206897,"last_synced_commit":"a08c621189c3e33c1073a71a60660bc2c1dfcac2"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fnode-xml-encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fnode-xml-encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fnode-xml-encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fnode-xml-encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/node-xml-encryption/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292040,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:53:18.078Z","updated_at":"2025-05-15T07:05:19.606Z","avatar_url":"https://github.com/auth0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/auth0/node-xml-encryption.png)](https://travis-ci.org/auth0/node-xml-encryption)\n\nW3C XML Encryption implementation for Node.js (http://www.w3.org/TR/xmlenc-core/)\n\nNode 18+ does not support Triple DES algorithms due to https://github.com/nodejs/node/issues/52017\n\n## Usage\n\n    npm install xml-encryption\n\n### encrypt\n\n~~~js\nvar xmlenc = require('xml-encryption');\n\nvar options = {\n  rsa_pub: fs.readFileSync(__dirname + '/your_rsa.pub'),\n  pem: fs.readFileSync(__dirname + '/your_public_cert.pem'),\n  encryptionAlgorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc',\n  keyEncryptionAlgorithm: 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',\n  keyEncryptionDigest: 'sha1',\n  disallowEncryptionWithInsecureAlgorithm: true,\n  warnInsecureAlgorithm: true\n};\n\nxmlenc.encrypt('content to encrypt', options, function(err, result) {\n    console.log(result);\n}\n~~~\n\nResult:\n~~~xml\n\u003cxenc:EncryptedData Type=\"http://www.w3.org/2001/04/xmlenc#Element\" xmlns:xenc=\"http://www.w3.org/2001/04/xmlenc#\"\u003e\n  \u003cxenc:EncryptionMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#aes-256-cbc\" /\u003e\n    \u003cKeyInfo xmlns=\"http://www.w3.org/2000/09/xmldsig#\"\u003e\n      \u003ce:EncryptedKey xmlns:e=\"http://www.w3.org/2001/04/xmlenc#\"\u003e\n        \u003ce:EncryptionMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p\"\u003e\n          \u003cDigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /\u003e\n        \u003c/e:EncryptionMethod\u003e\n        \u003cKeyInfo\u003e\n          \u003cX509Data\u003e\u003cX509Certificate\u003eMIIEDzCCAveg... base64 cert... q3uaLvlAUo=\u003c/X509Certificate\u003e\u003c/X509Data\u003e\n        \u003c/KeyInfo\u003e\n        \u003ce:CipherData\u003e\n          \u003ce:CipherValue\u003esGH0hhzkjmLWYYY0gyQMampDM... encrypted symmetric key ...gewHMbtZafk1MHh9A==\u003c/e:CipherValue\u003e\n        \u003c/e:CipherData\u003e\n      \u003c/e:EncryptedKey\u003e\n    \u003c/KeyInfo\u003e\n    \u003cxenc:CipherData\u003e\n        \u003cxenc:CipherValue\u003eV3Vb1vDl055Lp92zvK..... encrypted content.... kNzP6xTu7/L9EMAeU\u003c/xenc:CipherValue\u003e\n    \u003c/xenc:CipherData\u003e\n\u003c/xenc:EncryptedData\u003e\n~~~\n\n### decrypt\n\n~~~js\nvar options = {\n    key: fs.readFileSync(__dirname + '/your_private_key.key'),\n    disallowDecryptionWithInsecureAlgorithm: true,\n    warnInsecureAlgorithm: true\n};\n\nxmlenc.decrypt('\u003cxenc:EncryptedData ..... \u003c/xenc:EncryptedData\u003e', options, function(err, result) {\n    console.log(result);\n}\n\n// result\n\ndecrypted content\n~~~\n\n## Supported algorithms\n\nCurrently the library supports:\n\n* EncryptedKey to transport symmetric key using:\n  * http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p\n  * http://www.w3.org/2001/04/xmlenc#rsa-1_5 (Insecure Algorithm)\n\n* EncryptedData using:\n  * http://www.w3.org/2001/04/xmlenc#aes128-cbc\n  * http://www.w3.org/2001/04/xmlenc#aes256-cbc\n  * http://www.w3.org/2009/xmlenc11#aes128-gcm\n  * http://www.w3.org/2009/xmlenc11#aes256-gcm\n  * http://www.w3.org/2001/04/xmlenc#tripledes-cbc (Insecure Algorithm)\n\nInsecure Algorithms can be disabled via `disallowEncryptionWithInsecureAlgorithm`/`disallowDecryptionWithInsecureAlgorithm` flags when encrypting/decrypting. This flag is off by default in 0.x versions.\n\nA warning will be piped to `stderr` using console.warn() by default when the aforementioned algorithms are used. This can be disabled via the `warnInsecureAlgorithm` flag.\n\n## Issue Reporting\n\nIf 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](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\n## Author\n\n[Auth0](auth0.com)\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n\n## Releases\nRelease notes may be found under github release page: https://github.com/auth0/node-xml-encryption/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fnode-xml-encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fnode-xml-encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fnode-xml-encryption/lists"}