{"id":19413919,"url":"https://github.com/tpenaranda/vue-cryptojs","last_synced_at":"2025-09-27T03:31:46.687Z","repository":{"id":35162755,"uuid":"214739894","full_name":"tpenaranda/vue-cryptojs","owner":"tpenaranda","description":"A small wrapper for integrating crypto-js into VueJS","archived":false,"fork":false,"pushed_at":"2024-07-18T02:58:27.000Z","size":339,"stargazers_count":18,"open_issues_count":5,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-10T14:13:14.007Z","etag":null,"topics":["crypto-js","decrypt","encrypt","vue-cryptojs","vuejs","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tpenaranda.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":"2019-10-13T01:09:07.000Z","updated_at":"2024-07-18T02:56:21.000Z","dependencies_parsed_at":"2023-10-11T03:49:13.734Z","dependency_job_id":"950070f6-b4d2-42c6-80cc-a89a2f512727","html_url":"https://github.com/tpenaranda/vue-cryptojs","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":0.2727272727272727,"last_synced_commit":"1dbc74388e0a08e0a433773e30ab674287e45944"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpenaranda%2Fvue-cryptojs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpenaranda%2Fvue-cryptojs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpenaranda%2Fvue-cryptojs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpenaranda%2Fvue-cryptojs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpenaranda","download_url":"https://codeload.github.com/tpenaranda/vue-cryptojs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234382667,"owners_count":18823332,"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-js","decrypt","encrypt","vue-cryptojs","vuejs","wrapper"],"created_at":"2024-11-10T12:35:32.516Z","updated_at":"2025-09-27T03:31:46.355Z","avatar_url":"https://github.com/tpenaranda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-cryptojs\nA small wrapper for integrating crypto-js into Vue3 and Vue2\n\n## Discontinued\n\nActive development of Vue-CryptoJS has been discontinued. This library is no longer maintained.\n\nNowadays, NodeJS and modern browsers have a native `Crypto` module. The latest version of CryptoJS already uses the native Crypto module for random number generation, since `Math.random()` is not crypto-safe. Further development of CryptoJS would result in it only being a wrapper of native Crypto. Therefore, development and maintenance has been discontinued, it is time to go for the native `crypto` module.\n\n## How to install:\n```bash\nnpm install vue-cryptojs\n```\n\n### Vue3\nEntry file:\n```js\n\nimport { createApp } from 'vue'\nimport VueCryptojs from 'vue-cryptojs'\n\ncreateApp(...).use(VueCryptojs).mount(...)\n```\n\nTS Component:\n```js\n\u003cscript setup lang=\"ts\"\u003e\n  import { inject } from 'vue'\n  import CryptoJS from 'crypto-js'\n\n  const cryptojs = inject('cryptojs') as typeof CryptoJS\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cp\u003e{{cryptojs.AES.encrypt(\"Hi There!\", \"Secret Passphrase\").toString()}}\u003c/p\u003e\n  \u003cp\u003e{{cryptojs.AES.decrypt(\"U2FsdGVkX1/zclTGSirKJ+oYxGJFRR96i9MkjOb8X0s=\", \"Secret Passphrase\").toString(cryptojs.enc.Utf8)}}\u003c/p\u003e\n\u003c/template\u003e\n```\n\n`inject` on Composition API without TS:\n```js\n\u003cscript\u003e\nimport { inject } from 'vue'\n\nexport default {\n  setup() {\n    const cryoptojs = inject('cryptojs')\n\n    return {\n      cryoptojs\n    }\n  }\n}\n\u003c/script\u003e\n```\n\n### Vue2\n```js\nimport Vue from 'vue'\nimport VueCryptojs from 'vue-cryptojs'\n\nVue.use(VueCryptojs)\n```\n\nThis binds `CryptoJS` to `Vue` or `this` if you're using single file component.\n\nSimple AES text encrypt/decrypt example:\n```js\nconst encryptedText = this.$CryptoJS.AES.encrypt(\"Hi There!\", \"Secret Passphrase\").toString()\nconst decryptedText = this.$CryptoJS.AES.decrypt(encryptedText, \"Secret Passphrase\").toString(this.$CryptoJS.enc.Utf8)\n```\n\nDirectly on a template:\n```js\n\u003ctemplate\u003e\n  \u003cimg alt=\"Vue logo\" src=\"./assets/logo.png\" /\u003e\n  \u003cHelloWorld msg=\"Hello Vue 3 + Vite\" /\u003e\n  {{ $CryptoJS.AES.encrypt(\"Hi There!\", \"Secret Passphrase\").toString() }}\n\u003c/template\u003e\n```\n\nPlease kindly check full documention of [crypto-js](https://github.com/brix/crypto-js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpenaranda%2Fvue-cryptojs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpenaranda%2Fvue-cryptojs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpenaranda%2Fvue-cryptojs/lists"}