screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script> </head> <body> <div id="app"> <h3>Vue Js Encryption String</h3> <input v-model="stringToEncrypt" placeholder="Enter string to encrypt" /> <button @click="encryptString">Encrypt</button> <div v-if="encryptedString"> <p>Encrypted String:</p> <p>{{ encryptedString }}</p> </div> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { stringToEncrypt: 'password', secretKey: 'mySecretKey', encryptedString: '', }; }, methods: { encryptString() { this.encryptedString = CryptoJS.AES.encrypt( this.stringToEncrypt, this.secretKey ).toString(); }, }, }); </script> <style scoped> #app { max-width: 500px; margin: 0 auto; padding: 20px; font-family: Arial, sans-serif; } h3 { font-size: 20px; margin-bottom: 10px; } input { padding: 10px; width: 100%; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; } button { padding: 10px 20px; background-color: #4caf50; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; } button:hover { background-color: #45a049; } .result-container { margin-top: 20px; border: 1px solid #ccc; border-radius: 4px; padding: 10px; background-color: #f9f9f9; } p { margin: 0; font-size: 14px; } </style> </body> </html>