Secure your password with Vue JS encryption techniques

I am looking for a way to safely encrypt passwords on my Vue JS web application. While I already have a hash encrypter set up on the API, I am running into an issue where the password is displayed as plain text during the signin or signup call. Any recommendations on how to address this? My front-end is in Vue JS and the API is built using Node JS.

Answer №1

Issue resolved:
I came across this solution:

npm install crypto-js

CryptoJS is a handy tool that I utilize for my web application.

const CryptoJS = require("crypto-js")

methods: {

  encrypt (src) {
    const passphrase = '123456'
    return CryptoJS.AES.encrypt(src, passphrase).toString()
  },

  decrypt (src) {
    const passphrase = '123456'
    const bytes = CryptoJS.AES.decrypt(src, passphrase)
    const originalText = bytes.toString(CryptoJS.enc.Utf8)
    return originalText
  }
}

I gained knowledge from the following resources: labnol.org
For npm CryptoJS, visit: npmjs.com

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Back up and populate your Node.js data

Below is the Course Schema I am working with: const studentSchema = new mongoose.Schema({ name: { type: String, required: true }, current_education: { type: String, required: true }, course_name: { ...

Algorithm for Generating Cubes

My current task involves working with a dynamically generated array of cubes, each having its distinct position and color. These cubes are situated on a 5x5 field, where each cube is connected to at least one other cube. Now, I am looking to introduce a ne ...

Issues with performing Ajax requests within the Laravel and Vue.Js framework

After exhausting all my efforts trying to resolve this issue, I find myself stuck and frustrated. Despite including the CSRF token as suggested by various sources, the problem persists. The route is utilizing the default 'web' middleware. Confi ...

Comparing the efficiency of using arrays versus mapping to an object and accessing data in JavaScript

When considering the basics of computer science, it is understood that searching an unsorted list typically occurs in O(n) time, while direct access to an element in an array happens in O(1) time for HashMaps. So, which approach yields better performance: ...

Angular Material - Stick to the Top

Currently I am working with angular 4 along with angular material 2.0.0-beta.12. One thing I am aiming to implement is something known as "affix~" on the angular material website I am looking to create a layout similar to the image found here: https://i. ...

Utilizing React JS to assign various state values from a dropdown menu selection

In my project, I have implemented a dropdown list populated from an array of values. This dropdown is linked to a handleSelect function. const handleSelect = (e) => { handleShow() setCommunityName(e) } <DropdownButton id="dropdown-basi ...

Incorporating an HTML/Javascript game into a reactJS website: A step-by-step

After developing a game using plain javascript and HTML along with a few JS libraries, I find myself inquiring about the process of integrating this game into my ReactJS website. Typically, the game is initiated by opening the index.html file located with ...

Issue with Material Table: Pagination feature is not functioning as expected

Encountering an issue when trying to navigate between table pages, an error is displayed whether or not the page navigation button is clicked. The error message looks like this: https://i.sstatic.net/dEw0u.png Attempting to downgrade @material-ui/core did ...

Is there a bug in Firefox concerning the accuracy of document.body.getBoundingClientRect().top?

When I access Firefox version 17.0.1 and request document.body.getBoundingClientRect().top; on a simple site with no CSS styling applied, it returns an incorrect value. Instead of the expected 8, which is the default for the browser, it shows 21.4. However ...

The recursive component is functional exclusively outside of its own scope

I'm facing an issue where my recursive component is not nesting itself properly. The problem arises when I try to use the Recursive component inside another Recursive component. Although the root is correctly inserted into the Recursive component fro ...

What steps should I take to address and resolve this problem with my Angular $scope?

One of my partials utilizes a single controller named CaseNotesCtrl. However, I am encountering difficulties accessing $scope variables within this partial. Below is the code snippet: <div class="row" ng-show="$parent.loggedin" ng-controller="CaseNotes ...

Determining if the current URL in NextJS is the homepage

Just getting started with NextJS. I am trying to determine if the current URL is the home page. When I use: import { useRouter } from "next/router"; const router = useRouter(); const is_home = (router.pathname === ''); An error pops ...

What is the best way to retrieve the result of a JavaScript function in an HTML form?

I'm currently developing a JavaScript app that involves selecting a random question from an array and combining it with a random object from another array. Here's a glimpse of how my app is structured: Array.prototype.random = function (length) ...

various operations in routes using Express.js

Hey there, I am new to express js and I am looking to include multiple functions within routes. Can someone explain how to add multiple functions within a route? I have 2 functions in company.js but I am unsure how to export and add them in index.js. Here ...

Secure WebSocket connectivity

I'm currently attempting to test a secure websocket connection, but I'm encountering some difficulties. Below is the code snippet of my test scenario: var WebSocket = require('ws'); describe('testing Web Socket', function() ...

How to apply styles to a child component using CSS modules in a parent component

For the styling of a Material UI component (Paper) within a Menu component, I am referencing this documentation. To style my components using CSS modules with Webpack as the bundler, here's an example: // menu.js import React from 'react'; ...

When utilizing a prisma query with a callback function, it appears that try/catch blocks are being overlooked in Node.js

After referencing error handling methods from the prisma documentation, I encountered an issue with my code: try { prisma.daRevisionare.create({ data: { "idTweet": tweet.id, "testo": testotweet, url } }).then((dati) => { bo ...

Tips for transferring information from controller JavaScript to view JavaScript within AngularJS

Currently, I am working on an angularJS application where I retrieve data from a REST service within the controller. The retrieved data is then passed to the view using $scope. However, I encountered an issue when trying to use this data in my in-page Java ...

Adding dynamic metadata to a specific page in a next.js app using the router

I was unable to find the necessary information in the documentation, so I decided to seek help here. My goal is to include metadata for my blog posts, but I am struggling to figure out how to do that. Below is a shortened version of my articles/[slug]/page ...

I'm looking for a solution to reorganize my current state in order to display the image URL

My React component, which also utilizes TypeScript, is responsible for returning a photo to its parent component: import React, { useEffect, useState } from "react"; import axios from "axios"; export const Photo = () => { const [i ...