{"id":22250066,"url":"https://github.com/kraynel/js-rijndael","last_synced_at":"2025-07-15T05:47:50.326Z","repository":{"id":74192123,"uuid":"59957039","full_name":"kraynel/js-rijndael","owner":"kraynel","description":"Pure JS implementation of Rijndael cipher.","archived":false,"fork":false,"pushed_at":"2023-12-15T02:42:52.000Z","size":32,"stargazers_count":7,"open_issues_count":6,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-28T05:24:33.724Z","etag":null,"topics":["aes","aes-encryption","cipher","crypto","js-rijndael","mcrypt","rijndael"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kraynel.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":"2016-05-29T18:05:23.000Z","updated_at":"2024-06-19T04:12:35.337Z","dependencies_parsed_at":"2024-06-19T04:12:34.344Z","dependency_job_id":"3b8396f0-38eb-452d-829b-89905ef70724","html_url":"https://github.com/kraynel/js-rijndael","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kraynel%2Fjs-rijndael","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kraynel%2Fjs-rijndael/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kraynel%2Fjs-rijndael/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kraynel%2Fjs-rijndael/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kraynel","download_url":"https://codeload.github.com/kraynel/js-rijndael/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227869500,"owners_count":17832212,"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","aes-encryption","cipher","crypto","js-rijndael","mcrypt","rijndael"],"created_at":"2024-12-03T06:34:55.370Z","updated_at":"2024-12-03T06:34:56.125Z","avatar_url":"https://github.com/kraynel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JS-Rijndael\n\n[![CircleCI](https://circleci.com/gh/kraynel/js-rijndael.svg?style=svg)](https://circleci.com/gh/kraynel/js-rijndael)\n[![Coverage Status](https://coveralls.io/repos/github/kraynel/js-rijndael/badge.svg?branch=master)](https://coveralls.io/github/kraynel/js-rijndael?branch=master)\n[![Known Vulnerabilities](https://snyk.io/test/npm/js-rijndael/badge.svg)](https://snyk.io/test/npm/js-rijndael)\n\nJS-Rijndael is a port of F. Doering and B. Poettering implementation of Rijndael algorithm.\nIt has no external dependencies and is fully compatible with [mcrypt](http://php.net/manual/fr/book.mcrypt.php).\n\n## How to use\n\nAdd the dependency to your project: `npm install --save js-rijndael`.\nRequire it in your file.\n```js\nvar mcrypt = require('js-rijndael');\n```\n`mcrypt.listAlgorithms()` lists the available ciphers:\n- rijndael-128\n- rijndael-196\n- rijndael-256\n\n`mcrypt.listModes()` lists the available modes:\n- ecb\n- cbc\n- cfb\n- ncfb\n- nofb\n- ctr\n\nTwo methods are exposed: `encrypt` and `decrypt`. They take byte arrays as inputs (regular arrays).\n\n### Encrypt\n\n```js\nencryptedByteArray = mcrypt.encrypt(clearMessage, iv, key, cipherName, mode);\n```\n\n### Decrypt\n\n```js\nclearByteArray = mcrypt.decrypt(encryptedMessage, iv, key, cipherName, mode);\n```\n\n### Example\n\n```js\nvar base64 = require('base64-js');\n\nvar key = [].slice.call(base64.toByteArray(\"IkhCeiVpeE44RUliVmJDL1FnVltWNVomJn44RSZ4UWU=\"));\nvar iv = [].slice.call(base64.toByteArray(\"5DeaRfj4iHhBluFfyGDbPA==\"));\nvar message = [].slice.call(base64.toByteArray(\"8N6UX4G5c\\/DCtELUOEE5jAdlkLvjBpFQGvo\\/7fv3lrOfBUY\\/Ze545d5k1C\\/lA4zQ88rt52TB3Gz4egWJzerxZy41+sVSOrtLHrQR+Tv7NGfi+vSlZdmAsYVtHOHEPvImmkr+8k9hkKLlZELdY\\/mq2t5INTqtmPwxufJB\\/3LC+HPnnC0BGYxjvKIJ3jEBfzwcmOiyZG7iea\\/BLIZwoH9lUzRe8cR+eVjlTig9NW\\/tNMdkYBrxCXoK8XlNAXzjkgtq6c2Sd8keckHvEkYdSkie+ZaZvSwngCQgOKsiTs3jUJkedVnHM9VXLeUCocV17IldQxxghCK14hvLZ4WRCbtDHxMreCR3Rpwv11rWURpvmz0=\"));\nvar clearText = String.fromCharCode.apply(this, mcrypt.decrypt(message, iv, key, cipher.cipher, cipher.mode));\n\nconsole.log(clearText);\n```\n## Tests\n### Generate test data\n\nTwo solutions:\n\n- With `php` and `mcrypt`, run `php generateTests.php \u003e ../test-data.js`\n- With `docker`, run `./generateTests.sh`\n\n### Run tests\nWith the test data generated, run `npm test`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkraynel%2Fjs-rijndael","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkraynel%2Fjs-rijndael","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkraynel%2Fjs-rijndael/lists"}