Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-cryptojs

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-cryptojs

A small wrapper for integrating crypto-js into VueJS

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3K
decreased by-8.06%
Maintainers
1
Weekly downloads
 
Created
Source

vue-cryptojs

A small wrapper for integrating crypto-js into Vue3 and Vue2

How to install:

npm install vue-cryptojs

And in your entry file:

// Vue3
import { createApp } from 'vue'
import VueCryptojs from 'vue-cryptojs'

const app = createApp(...)
app.use(VueCryptojs)
app.mount('#app')

// Vue2
import Vue from 'vue'
import VueCryptojs from 'vue-cryptojs'

Vue.use(VueCryptojs)

Usage:

This wrapper bind CryptoJS to Vue or this if you're using single file component.

Simple AES text encrypt/decrypt example:

const encryptedText = this.$CryptoJS.AES.encrypt("Hi There!", "Secret Passphrase").toString()
const decryptedText = this.$CryptoJS.AES.decrypt(encryptedText, "Secret Passphrase").toString(this.CryptoJS.enc.Utf8)

For Vue3 we suggest to use inject on Composition API:

<script>
import { inject } from 'vue'

export default {
  setup() {
    const cryoptojs = inject('cryptojs')

    return {
      cryoptojs
    }
  }
}
</script>

Please kindly check full documention of crypto-js

Keywords

FAQs

Package last updated on 16 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc