Encryption Decryption User Details Using Crypto-JS Library to secure application in React

hello developers today we talk about a library named is crypto-js
so why we use this library in our development.
because it secure aur informaion from malicius user.

It encrypt our information in cipher text. and we decrypt that text in our
servers f…


This content originally appeared on DEV Community and was authored by Deepak

hello developers today we talk about a library named is crypto-js
so why we use this library in our development.
because it secure aur informaion from malicius user.

It encrypt our information in cipher text. and we decrypt that text in our
servers file to verify on behalf of secret key.

npm install crypto-js --save

encrypt information

var CryptoJS = require("crypto-js");

// Encrypt
var ciphertext = CryptoJS.AES.encrypt('user info', 'secret key').toString();


Decrypt information

var CryptoJS = require("crypto-js");
var bytes  = CryptoJS.AES.decrypt(ciphertext, 'secret key');
var originalText = bytes.toString(CryptoJS.enc.Utf8);

The main reason using this library because some use check their history to see their payload on login time user inter into the login form. so we can use crypto library to secure application

Image description


This content originally appeared on DEV Community and was authored by Deepak


Print Share Comment Cite Upload Translate Updates
APA

Deepak | Sciencx (2022-01-15T08:05:15+00:00) Encryption Decryption User Details Using Crypto-JS Library to secure application in React. Retrieved from https://www.scien.cx/2022/01/15/encryption-decryption-user-details-using-crypto-js-library-to-secure-application-in-react/

MLA
" » Encryption Decryption User Details Using Crypto-JS Library to secure application in React." Deepak | Sciencx - Saturday January 15, 2022, https://www.scien.cx/2022/01/15/encryption-decryption-user-details-using-crypto-js-library-to-secure-application-in-react/
HARVARD
Deepak | Sciencx Saturday January 15, 2022 » Encryption Decryption User Details Using Crypto-JS Library to secure application in React., viewed ,<https://www.scien.cx/2022/01/15/encryption-decryption-user-details-using-crypto-js-library-to-secure-application-in-react/>
VANCOUVER
Deepak | Sciencx - » Encryption Decryption User Details Using Crypto-JS Library to secure application in React. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/15/encryption-decryption-user-details-using-crypto-js-library-to-secure-application-in-react/
CHICAGO
" » Encryption Decryption User Details Using Crypto-JS Library to secure application in React." Deepak | Sciencx - Accessed . https://www.scien.cx/2022/01/15/encryption-decryption-user-details-using-crypto-js-library-to-secure-application-in-react/
IEEE
" » Encryption Decryption User Details Using Crypto-JS Library to secure application in React." Deepak | Sciencx [Online]. Available: https://www.scien.cx/2022/01/15/encryption-decryption-user-details-using-crypto-js-library-to-secure-application-in-react/. [Accessed: ]
rf:citation
» Encryption Decryption User Details Using Crypto-JS Library to secure application in React | Deepak | Sciencx | https://www.scien.cx/2022/01/15/encryption-decryption-user-details-using-crypto-js-library-to-secure-application-in-react/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.