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
How to enable BitLocker encryption on Windows
LibGuides: Pedagogy to Oppress?
$4,500,000 - 645 Matanzas CT, Fort Myers Beach, FL, 33931, William Raveis Real Estate, Mortgage, and Insurance
Frases para un bendecido domingo: llena tu día con palabras de gratitud y esperanza - Blogfrases
Poe T4 Aisling
Ohio Houses With Land for Sale - 1,591 Properties
Katmoie
Free Atm For Emerald Card Near Me
Davante Adams Wikipedia
Watch Mashle 2nd Season Anime Free on Gogoanime
Geodis Logistic Joliet/Topco
What Auto Parts Stores Are Open
The Best Classes in WoW War Within - Best Class in 11.0.2 | Dving Guides
Premier Boating Center Conroe
Purple Crip Strain Leafly
Morocco Forum Tripadvisor
Nene25 Sports
Tamilrockers Movies 2023 Download
Paychex Pricing And Fees (2024 Guide)
Invert Clipping Mask Illustrator
Hanger Clinic/Billpay
G Switch Unblocked Tyrone
Conan Exiles: Nahrung und Trinken finden und herstellen
Amazing deals for Abercrombie & Fitch Co. on Goodshop!
Understanding Genetics
Ivegore Machete Mutolation
Thick Ebony Trans
D2L Brightspace Clc
Roanoke Skipthegames Com
A Christmas Horse - Alison Senxation
Accuradio Unblocked
Account Now Login In
Receptionist Position Near Me
O'reilly's In Mathis Texas
Effingham Daily News Police Report
3 Ways to Format a Computer - wikiHow
Top Songs On Octane 2022
Sinai Sdn 2023
Kids and Adult Dinosaur Costume
Roadtoutopiasweepstakes.con
Truis Bank Near Me
Truckers Report Forums
Skyrim:Elder Knowledge - The Unofficial Elder Scrolls Pages (UESP)
Rage Of Harrogath Bugged
M Life Insider
1Exquisitetaste
Dragon Ball Super Super Hero 123Movies
Interminable Rooms
Booknet.com Contract Marriage 2
Cult Collectibles - True Crime, Cults, and Murderabilia
Bbwcumdreams
28 Mm Zwart Spaanplaat Gemelamineerd (U999 ST9 Matte | RAL9005) Op Maat | Zagen Op Mm + ABS Kantenband
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.