{"id":16530617,"url":"https://github.com/hazmi35/nano-aes","last_synced_at":"2026-03-15T00:54:41.207Z","repository":{"id":149896817,"uuid":"621933365","full_name":"Hazmi35/nano-aes","owner":"Hazmi35","description":"Simple \u0026 lightweight AES (Advanced Encryption Standard) module. Wrapper for Node.js crypto module.","archived":false,"fork":false,"pushed_at":"2025-03-11T14:19:50.000Z","size":388,"stargazers_count":8,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T15:33:47.023Z","etag":null,"topics":["aes","cryptography","decrypt","encrypt","encryption","nano-aes","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Hazmi35.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":"2023-03-31T17:53:42.000Z","updated_at":"2024-11-28T19:19:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c513ec7-84e1-4499-8739-baa207c0077a","html_url":"https://github.com/Hazmi35/nano-aes","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hazmi35%2Fnano-aes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hazmi35%2Fnano-aes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hazmi35%2Fnano-aes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hazmi35%2Fnano-aes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hazmi35","download_url":"https://codeload.github.com/Hazmi35/nano-aes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826780,"owners_count":20354220,"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":["aes","cryptography","decrypt","encrypt","encryption","nano-aes","nodejs","typescript"],"created_at":"2024-10-11T18:06:37.394Z","updated_at":"2026-03-15T00:54:41.156Z","avatar_url":"https://github.com/Hazmi35.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nano-aes\n\nSimple \u0026 lightweight AES (Advanced Encryption Standard) module. Wrapper for Node.js crypto module.\n\nFeatures:\n- Supports CBC, CTR, and GCM mode.\n- Supports 128, 192, and 256 key sizes/length.\n- Uses a secure randomized IV from a cryptographically strong pseudorandom data\n- Lightweight with no dependencies (With only ~9.9kB of unpacked size!)\n- Easy to use\n- Supported both from ESM and CommonJS (We bundle for both)\n- Backwards compatible down to Node.js v14 and even v12! _*1_\n\n## Example\n```js\nconst { NanoAES } = require(\"nano-aes\");\n// or with ESM\nimport { NanoAES } from \"nano-aes\";\n\n// In this case, the key is a string, so it's 24 bytes long (192 bits)\nconst AESCipher = new NanoAES({ key: \"abcdefghijklmnopqrstuvwx\", mode: \"ctr\" });\n// Or you can a random key generate from the static method\nconst AESCipher = new NanoAES({ key: NanoAES.generateKey(192), mode: \"ctr\" });\n// Or use a Buffer\nconst AESCipher = new NanoAES({ key: Buffer.from(\"6162636465666768696a6b6c6d6e6f707172737475767778\", \"hex\"), mode: \"ctr\"})\n// Or use a KeyObject directly\nconst AESCipher = new NanoAES({ key: crypto.createSecretKey(\"abcdefghijklmnopqrstuvwx\", \"utf8\"), mode: \"ctr\" });\n\nconst encrypted = AESCipher.encrypt(\"Hello World!\").toString(\"hex\");\nconst decrypted = AESCipher.decrypt(Buffer.from(encrypted, \"hex\")).toString(\"utf8\");\n\nconsole.log(encrypted); // [Some Encrypted Data]\nconsole.log(decrypted); // Hello World!\n```\n\n### Footnote\n_*1_ The officially supported Node.js version is from v14, but you can still use this module in Node.js v12. But it is not recommended.\n\nNode.js v12 are **EOL** and doesn't receive OpenSSL updates, which what `node:crypto` module used, which means no security updates.\n\nSee what OpenSSL version your Node.js is linked to with `process.versions.openssl`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazmi35%2Fnano-aes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazmi35%2Fnano-aes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazmi35%2Fnano-aes/lists"}