{"id":22392195,"url":"https://github.com/idimetrix/key-encode-decode","last_synced_at":"2025-07-31T09:31:30.767Z","repository":{"id":257470751,"uuid":"858446486","full_name":"idimetrix/key-encode-decode","owner":"idimetrix","description":"`key-encode-decode` is a simple Node.js package for encoding and decoding strings using a specified key with AES-256-CBC encryption.","archived":false,"fork":false,"pushed_at":"2024-09-16T22:56:57.000Z","size":62,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-01T15:15:48.157Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idimetrix.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":"2024-09-16T22:56:31.000Z","updated_at":"2024-10-22T08:22:39.000Z","dependencies_parsed_at":"2024-09-17T00:43:58.215Z","dependency_job_id":"6471b51f-fad1-49c7-8a8e-3aa6671cf543","html_url":"https://github.com/idimetrix/key-encode-decode","commit_stats":null,"previous_names":["idimetrix/key-encode-decode"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idimetrix%2Fkey-encode-decode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idimetrix%2Fkey-encode-decode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idimetrix%2Fkey-encode-decode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idimetrix%2Fkey-encode-decode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idimetrix","download_url":"https://codeload.github.com/idimetrix/key-encode-decode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227786775,"owners_count":17819777,"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-12-05T04:15:43.479Z","updated_at":"2024-12-05T04:15:44.103Z","avatar_url":"https://github.com/idimetrix.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# key-encode-decode\n`key-encode-decode` is a simple Node.js package for encoding and decoding strings using a specified key with AES-256-CBC encryption.\n\n## Installation\n\nTo install the package, use npm:\n\n```bash\npnpm add key-encode-decode\n\nyarn install key-encode-decode\n\nnpm install key-encode-decode\n```\n\n## Usage\n\n```typescript\nimport { encodeWithKey, decodeWithKey } from 'key-encode-decode';\n\nconst key = 'your-encryption-key-32-characters-long'; // Ensure the key is 32 characters long\nconst data = 'Hello, World!';\n\n// Encode the data\nconst encoded = encodeWithKey(data, key);\nconsole.log('Encoded:', encoded);\n\n// Decode the data\nconst decoded = decodeWithKey(encoded, key);\nconsole.log('Decoded:', decoded);\n```\n\n\n## encodeWithKey(decodedData: string, key: string): string\nEncodes a string using the specified key. The key must be a 32-character string (256 bits).\n\n### Parameters:\n\n### decodedData: The string to be encoded.\nkey: The encryption key (must be 32 characters long).\nReturns:\n\nThe encoded string in hexadecimal format.\n\n## decodeWithKey(encodedData: string, key: string): string\nDecodes a string using the specified key. The key must be a 32-character string (256 bits).\n\n### Parameters:\n\n### encodedData: The string to be decoded (in hexadecimal format).\nkey: The encryption key (must be 32 characters long).\nReturns:\n\nThe decoded string.\n\n## tsup\nBundle your TypeScript library with no config, powered by esbuild.\n\nhttps://tsup.egoist.dev/\n\n## How to use this\n1. install dependencies\n```\n# pnpm\n$ pnpm install\n\n# yarn\n$ yarn install\n\n# npm\n$ npm install\n```\n2. Add your code to `src`\n3. Add export statement to `src/index.ts`\n4. Test build command to build `src`.\nOnce the command works properly, you will see `dist` folder.\n\n```zsh\n# pnpm\n$ pnpm run build\n\n# yarn\n$ yarn run build\n\n# npm\n$ npm run build\n```\n5. Publish your package\n\n```zsh\n$ npm publish\n```\n\n\n## test package\nhttps://www.npmjs.com/package/key-encode-decode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidimetrix%2Fkey-encode-decode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidimetrix%2Fkey-encode-decode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidimetrix%2Fkey-encode-decode/lists"}