{"id":18458757,"url":"https://github.com/browserify/evp_bytestokey","last_synced_at":"2025-04-08T05:34:34.264Z","repository":{"id":60775051,"uuid":"43249102","full_name":"browserify/EVP_BytesToKey","owner":"browserify","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-21T09:59:49.000Z","size":18,"stargazers_count":19,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T13:39:56.815Z","etag":null,"topics":["crypto","javascript","openssl"],"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/browserify.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":"2015-09-27T14:13:51.000Z","updated_at":"2025-02-25T21:36:24.000Z","dependencies_parsed_at":"2025-01-25T22:35:15.402Z","dependency_job_id":"31ed6c24-cef5-4215-b0aa-43baea8a13e1","html_url":"https://github.com/browserify/EVP_BytesToKey","commit_stats":null,"previous_names":["crypto-browserify/EVP_BytesToKey","crypto-browserify/evp_bytestokey"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2FEVP_BytesToKey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2FEVP_BytesToKey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2FEVP_BytesToKey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2FEVP_BytesToKey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/EVP_BytesToKey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785919,"owners_count":20995641,"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":["crypto","javascript","openssl"],"created_at":"2024-11-06T08:19:54.512Z","updated_at":"2025-04-08T05:34:29.251Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EVP\\_BytesToKey\n[![NPM Package](https://img.shields.io/npm/v/evp_bytestokey.svg?style=flat-square)](https://www.npmjs.org/package/evp_bytestokey)\n[![Build Status](https://img.shields.io/travis/crypto-browserify/EVP_BytesToKey.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/crypto-browserify/EVP_BytesToKey)\n[![Dependency status](https://img.shields.io/david/crypto-browserify/EVP_BytesToKey.svg?style=flat-square)](https://david-dm.org/crypto-browserify/EVP_BytesToKey#info=dependencies)\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\nThe insecure [key derivation algorithm from OpenSSL.][1]\n\n**WARNING: DO NOT USE, except for compatibility reasons.**\n\nMD5 is insecure.\n\nUse at least `scrypt` or `pbkdf2-hmac-sha256` instead.\n\n\n## API\n`EVP_BytesToKey(password, salt, keyLen, ivLen)`\n\n* `password` - `Buffer`, password used to derive the key data.\n* `salt` - 8 byte `Buffer` or `null`, salt is used as a salt in the derivation.\n* `keyBits` - `number`, key length in **bits**.\n* `ivLen` - `number`, iv length in bytes.\n\n*Returns*: `{ key: Buffer, iv: Buffer }`\n\n\n## Examples\nMD5 with `aes-256-cbc`:\n\n```js\nconst crypto = require('crypto')\nconst EVP_BytesToKey = require('evp_bytestokey')\n\nconst result = EVP_BytesToKey(\n  'my-secret-password',\n  null,\n  256,\n  16\n)\n// =\u003e\n// { key: \u003cBuffer a2 d9 67 9c 7f ff 3e 9c f4 30 0a 2c c3 fb ad 79 59 ed ae e8 a4 3c 1a 9d 71 68 ea c4 68 08 a5 7a\u003e,\n//  iv: \u003cBuffer bf 5e 15 5a 28 94 3b 10 46 31 24 84 60 9c 5f 3c\u003e }\n\nconst cipher = crypto.createCipheriv('aes-256-cbc', result.key, result.iv)\n```\n\n## LICENSE [MIT](LICENSE)\n\n[1]: https://wiki.openssl.org/index.php/Manual:EVP_BytesToKey(3)\n[2]: https://nodejs.org/api/crypto.html#crypto_class_hash\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fevp_bytestokey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Fevp_bytestokey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fevp_bytestokey/lists"}