{{cryptojs.AES.encrypt("Hi There!", "Secret Passphrase").toString()}}
36 |{{cryptojs.AES.decrypt("U2FsdGVkX1/zclTGSirKJ+oYxGJFRR96i9MkjOb8X0s=", "Secret Passphrase").toString(cryptojs.enc.Utf8)}}
37 | 38 | ``` 39 | 40 | `inject` on Composition API without TS: 41 | ```js 42 | 55 | ``` 56 | 57 | ### Vue2 58 | ```js 59 | import Vue from 'vue' 60 | import VueCryptojs from 'vue-cryptojs' 61 | 62 | Vue.use(VueCryptojs) 63 | ``` 64 | 65 | This binds `CryptoJS` to `Vue` or `this` if you're using single file component. 66 | 67 | Simple AES text encrypt/decrypt example: 68 | ```js 69 | const encryptedText = this.$CryptoJS.AES.encrypt("Hi There!", "Secret Passphrase").toString() 70 | const decryptedText = this.$CryptoJS.AES.decrypt(encryptedText, "Secret Passphrase").toString(this.$CryptoJS.enc.Utf8) 71 | ``` 72 | 73 | Directly on a template: 74 | ```js 75 | 76 |
77 |