{"id":20811668,"url":"https://github.com/myetherwallet/jsonsignandencrypt","last_synced_at":"2025-10-27T22:12:58.383Z","repository":{"id":57285336,"uuid":"85259802","full_name":"MyEtherWallet/JSONSignAndEncrypt","owner":"MyEtherWallet","description":null,"archived":false,"fork":false,"pushed_at":"2017-03-17T05:12:56.000Z","size":5,"stargazers_count":15,"open_issues_count":0,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-31T09:12:00.031Z","etag":null,"topics":["decryption","ecies","encryption","javascript","json","signing"],"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/MyEtherWallet.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}},"created_at":"2017-03-17T01:57:20.000Z","updated_at":"2024-07-21T01:49:47.000Z","dependencies_parsed_at":"2022-09-19T22:42:42.407Z","dependency_job_id":null,"html_url":"https://github.com/MyEtherWallet/JSONSignAndEncrypt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyEtherWallet%2FJSONSignAndEncrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyEtherWallet%2FJSONSignAndEncrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyEtherWallet%2FJSONSignAndEncrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyEtherWallet%2FJSONSignAndEncrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MyEtherWallet","download_url":"https://codeload.github.com/MyEtherWallet/JSONSignAndEncrypt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225089033,"owners_count":17419239,"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":["decryption","ecies","encryption","javascript","json","signing"],"created_at":"2024-11-17T20:46:07.443Z","updated_at":"2025-10-27T22:12:58.296Z","avatar_url":"https://github.com/MyEtherWallet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON sigining and encryption\n\nlibrary to make signing and encrypting json object easier\n\n# Features!\n\n  - Generate deterministic string to verify based on json and sign the string\n  - No more signing failures due to JSON object not maintaining the same order\n  - ECIES encryption/decryption on JSON\n\n### Installation\n```sh\n$ npm install json-sign-and-encrypt\n```\n### Examples\n\nGenerate ethereum address:\n```\nvar signUtils = require(\"../index.js\");\nvar crypto = require(\"crypto\");\nvar objectToEncrypt = {\n    \"glossary\": {\n        \"title\": \"example glossary\",\n        \"GlossDiv\": {\n            \"title\": \"S\",\n            \"GlossList\": {\n                \"GlossEntry\": {\n                    \"ID\": \"SGML\",\n                    \"SortAs\": \"SGML\",\n                    \"GlossTerm\": \"Standard Generalized Markup Language\",\n                    \"Acronym\": \"SGML\",\n                    \"Abbrev\": \"ISO 8879:1986\",\n                    \"GlossDef\": {\n                        \"para\": \"A meta-markup language, used to create markup languages such as DocBook.\",\n                        \"GlossSeeAlso\": [\"GML\", \"XML\"]\n                    },\n                    \"GlossSee\": \"markup\"\n                }\n            }\n        }\n    }\n}\n\nvar clientPrivKey = crypto.randomBytes(32);\nvar clientpubKey = signUtils.getPublicKey(clientPrivKey);\nvar serverPrivKey = crypto.randomBytes(32);\nvar serverPubKey = signUtils.getPublicKey(serverPrivKey);\n\n//signing and encrypting\nsignUtils.signAndEncrypt(objectToEncrypt, clientPrivKey, serverPubKey).then(function(encrypted) {\n    console.log(encrypted);\n    //decrypting and verifying \n    signUtils.decryptAndVerify(encrypted, serverPrivKey, clientpubKey).then(function(decrypted) {\n        //encrypted is the encrypted object\n        console.log(decrypted);\n    }).catch(function(err) {\n        //will throw error on verification failure\n    });\n\n});\n```\n\nLicense\n----\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyetherwallet%2Fjsonsignandencrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyetherwallet%2Fjsonsignandencrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyetherwallet%2Fjsonsignandencrypt/lists"}