{"id":31529378,"url":"https://github.com/aooppo/json-secure-crypt","last_synced_at":"2026-05-14T12:35:15.870Z","repository":{"id":254055835,"uuid":"845350845","full_name":"aooppo/json-secure-crypt","owner":"aooppo","description":"json-secure-crypt is a Node.js package that provides tools to securely encrypt and decrypt JSON files using AES encryption. It supports both local files and remote files accessed via URLs, with optional proxy configuration.","archived":false,"fork":false,"pushed_at":"2024-08-21T07:23:59.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T05:45:02.385Z","etag":null,"topics":["aes","decrypt","encrypt","json"],"latest_commit_sha":null,"homepage":"https://github.com/aooppo/json-secure-crypt","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aooppo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-21T04:45:56.000Z","updated_at":"2025-08-25T02:16:41.000Z","dependencies_parsed_at":"2024-08-21T05:56:36.567Z","dependency_job_id":"58ae6bdf-881b-46bf-a2a7-14e8f58d7d77","html_url":"https://github.com/aooppo/json-secure-crypt","commit_stats":null,"previous_names":["aooppo/json-secure-crypt"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aooppo/json-secure-crypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aooppo%2Fjson-secure-crypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aooppo%2Fjson-secure-crypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aooppo%2Fjson-secure-crypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aooppo%2Fjson-secure-crypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aooppo","download_url":"https://codeload.github.com/aooppo/json-secure-crypt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aooppo%2Fjson-secure-crypt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33025234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aes","decrypt","encrypt","json"],"created_at":"2025-10-04T01:07:15.497Z","updated_at":"2026-05-14T12:35:15.842Z","avatar_url":"https://github.com/aooppo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-secure-crypt\n\n`json-secure-crypt` is a Node.js package that provides tools to securely encrypt and decrypt JSON files using AES encryption. It supports both local files and remote files accessed via URLs, with optional proxy configuration.\n\n## Installation\n\nTo install the package, use one of the following commands:\n\n### Using npm:\n\n```bash\nnpm install json-secure-crypt\n```\n\n### Using Yarn:\n\n```bash\nyarn add json-secure-crypt\n```\n\n## Usage\n\n### Command-Line Interface (CLI) Usage\n\nThis package provides two primary command-line tools: `encrypt` and `decrypt`, which can be executed via npm or Yarn scripts.\n\n#### 1. Encrypt a JSON File\n\nEncrypt a local JSON file and save the encrypted content to a new file:\n\n#### Using npm:\n\n```bash\nnpm run encrypt -- \u003cinput-file-path\u003e \u003coutput-file-path\u003e \u003csecret-key\u003e\n```\n\n#### Using Yarn:\n\n```bash\nyarn encrypt \u003cinput-file-path\u003e \u003coutput-file-path\u003e \u003csecret-key\u003e\n```\n\n- `\u003cinput-file-path\u003e`: Path to the JSON file you want to encrypt.\n- `\u003coutput-file-path\u003e`: Path where the encrypted file will be saved.\n- `\u003csecret-key\u003e`: The secret key used for encryption. Keep this key safe, as it will be required to decrypt the file.\n\n**Example:**\n\n```bash\nnpm run encrypt -- ./data.json ./encrypted-data.json mySecretKey123\n```\n\nor using Yarn:\n\n```bash\nyarn encrypt ./data.json ./encrypted-data.json mySecretKey123\n```\n\n#### 2. Decrypt a Local JSON File\n\nDecrypt a local encrypted JSON file and save the decrypted content to a new file:\n\n#### Using npm:\n\n```bash\nnpm run decrypt -- \u003cinput-file-path\u003e \u003coutput-file-path\u003e \u003csecret-key\u003e\n```\n\n#### Using Yarn:\n\n```bash\nyarn decrypt \u003cinput-file-path\u003e \u003coutput-file-path\u003e \u003csecret-key\u003e\n```\n\n- `\u003cinput-file-path\u003e`: Path to the encrypted JSON file.\n- `\u003coutput-file-path\u003e`: Path where the decrypted file will be saved.\n- `\u003csecret-key\u003e`: The secret key used to decrypt the file.\n\n**Example:**\n\n```bash\nnpm run decrypt -- ./encrypted-data.json ./decrypted-data.json mySecretKey123\n```\n\nor using Yarn:\n\n```bash\nyarn decrypt ./encrypted-data.json ./decrypted-data.json mySecretKey123\n```\n\n#### 3. Decrypt a Remote JSON File\n\nYou can also decrypt a JSON file hosted remotely via a URL:\n\n#### Using npm:\n\n```bash\nnpm run decrypt -- \u003curl\u003e \u003coutput-file-path\u003e \u003csecret-key\u003e [proxy-host:proxy-port]\n```\n\n#### Using Yarn:\n\n```bash\nyarn decrypt \u003curl\u003e \u003coutput-file-path\u003e \u003csecret-key\u003e [proxy-host:proxy-port]\n```\n\n- `\u003curl\u003e`: The URL of the remote JSON file.\n- `\u003coutput-file-path\u003e`: Path where the decrypted file will be saved.\n- `\u003csecret-key\u003e`: The secret key used to decrypt the file.\n- `[proxy-host:proxy-port]` (optional): If your network requires a proxy to access the internet, specify the proxy host and port here.\n\n**Example:**\n\n```bash\nnpm run decrypt -- https://example.com/encrypted.json ./decrypted.json mySecretKey123\n```\n\nor using Yarn:\n\n```bash\nyarn decrypt https://example.com/encrypted.json ./decrypted.json mySecretKey123\n```\n\n**Example with Proxy:**\n\n```bash\nnpm run decrypt -- https://example.com/encrypted.json ./decrypted.json mySecretKey123 127.0.0.1:7890\n```\n\nor using Yarn:\n\n```bash\nyarn decrypt https://example.com/encrypted.json ./decrypted.json mySecretKey123 127.0.0.1:7890\n```\n\n### Programmatic Usage\n\nYou can also use the encryption and decryption functions in your Node.js code.\n\n```javascript\nconst { encryptJson, decryptJson } = require('json-secure-crypt');\n\n// Encrypt JSON data\nconst jsonData = { key: 'value' };\nconst secretKey = 'mySecretKey123';\nconst encryptedData = encryptJson(jsonData, secretKey);\n\n// Decrypt JSON data\nconst decryptedData = decryptJson(encryptedData, secretKey);\nconsole.log(decryptedData); // Output: { key: 'value' }\n```\n\n### Decrypting from a URL in Your Code\n\nIf you need to decrypt JSON data from a remote URL within your application, you can do so as follows:\n\n```javascript\nconst { decryptJsonFromUrl } = require('json-secure-crypt');\n\nconst url = 'https://example.com/encrypted.json';\nconst secretKey = 'mySecretKey123';\nconst proxyConfig = {\n    host: '127.0.0.1',\n    port: 8080\n};\n\ndecryptJsonFromUrl(url, secretKey, proxyConfig)\n    .then(decryptedData =\u003e {\n        console.log(decryptedData);\n    })\n    .catch(err =\u003e {\n        console.error('Error during decryption:', err);\n    });\n```\n\n### License\n\nThis package is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faooppo%2Fjson-secure-crypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faooppo%2Fjson-secure-crypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faooppo%2Fjson-secure-crypt/lists"}