vue-cryptojs (2024)

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

Discontinued

Active development of Vue-CryptoJS has been discontinued. This library is no longer maintained.

Nowadays, 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.

How to install:

npm install vue-cryptojs

Vue3

Entry file:

import { createApp } from 'vue'import VueCryptojs from 'vue-cryptojs'createApp(...).use(VueCryptojs).mount(...)

TS Component:

<script setup lang="ts"> import { inject } from 'vue' import CryptoJS from 'crypto-js' const cryptojs = inject('cryptojs') as typeof CryptoJS</script><template> <p>{{cryptojs.AES.encrypt("Hi There!", "Secret Passphrase").toString()}}</p> <p>{{cryptojs.AES.decrypt("U2FsdGVkX1/zclTGSirKJ+oYxGJFRR96i9MkjOb8X0s=", "Secret Passphrase").toString(cryptojs.enc.Utf8)}}</p></template>

inject on Composition API without TS:

<script>import { inject } from 'vue'export default { setup() { const cryoptojs = inject('cryptojs') return { cryoptojs } }}</script>

Vue2

import Vue from 'vue'import VueCryptojs from 'vue-cryptojs'Vue.use(VueCryptojs)

This binds 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)

Directly on a template:

<template> <img alt="Vue logo" src="./assets/logo.png" /> <HelloWorld msg="Hello Vue 3 + Vite" /> {{ $CryptoJS.AES.encrypt("Hi There!", "Secret Passphrase").toString() }}</template>

Please kindly check full documention of crypto-js

vue-cryptojs (2024)
Top Articles
CRC Credit Bureau Limited | The Leading Credit Bureau Company in Nigeria
What is Escalation Matrix & How Does It Work? [Types, Process]
Duralast Gold Cv Axle
Unit 30 Quiz: Idioms And Pronunciation
Pga Scores Cbs
Best Transmission Service Margate
Mohawkind Docagent
Crazybowie_15 tit*
Best Restaurants In Seaside Heights Nj
Smokeland West Warwick
Tight Tiny Teen Scouts 5
Azeroth Pilot Reloaded - Addons - World of Warcraft
The Rise of Breckie Hill: How She Became a Social Media Star | Entertainment
More Apt To Complain Crossword
Craigslist Alabama Montgomery
Scholarships | New Mexico State University
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis - NFL
Louisiana Sportsman Classifieds Guns
Extra Virgin Coconut Oil Walmart
Gem City Surgeons Miami Valley South
Zack Fairhurst Snapchat
Aris Rachevsky Harvard
Libinick
Dover Nh Power Outage
Teacup Yorkie For Sale Up To $400 In South Carolina
Heart Ring Worth Aj
Red8 Data Entry Job
Ewg Eucerin
How To Make Infinity On Calculator
Grandstand 13 Fenway
Rocksteady Steakhouse Menu
Southern Democrat vs. MAGA Republican: Why NC governor race is a defining contest for 2024
Glossytightsglamour
Timothy Kremchek Net Worth
Agematch Com Member Login
Naya Padkar Newspaper Today
Gold Nugget at the Golden Nugget
9 oplossingen voor het laptoptouchpad dat niet werkt in Windows - TWCB (NL)
Fwpd Activity Log
Torrid Rn Number Lookup
Sams Gas Price Sanford Fl
Natasha Tosini Bikini
Wordle Feb 27 Mashable
Tinfoil Unable To Start Software 2022
Advance Auto.parts Near Me
Iman Fashion Clearance
Contico Tuff Box Replacement Locks
855-539-4712
Craigslist Chautauqua Ny
Glowforge Forum
The Ultimate Guide To 5 Movierulz. Com: Exploring The World Of Online Movies
Bellin Employee Portal
Latest Posts
Article information

Author: Ms. Lucile Johns

Last Updated:

Views: 6252

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Ms. Lucile Johns

Birthday: 1999-11-16

Address: Suite 237 56046 Walsh Coves, West Enid, VT 46557

Phone: +59115435987187

Job: Education Supervisor

Hobby: Genealogy, Stone skipping, Skydiving, Nordic skating, Couponing, Coloring, Gardening

Introduction: My name is Ms. Lucile Johns, I am a successful, friendly, friendly, homely, adventurous, handsome, delightful person who loves writing and wants to share my knowledge and understanding with you.