Code Monkey home page Code Monkey logo

Comments (8)

evanvosberg avatar evanvosberg commented on September 27, 2024 12

This means your json can't be stringified ... it's not related to Crypto-JS.

from crypto-js.

zbagley avatar zbagley commented on September 27, 2024 2

For those of you hitting this issue, there's a good chance that you're using a CryptoJS CipherParams rather than the string you're probably looking for. Quick fix is to call .toString() or .toString(<encoding type>) to get the actual string object rather than the attempting to work with the CipherParams after calling AES.encrypt(...).

from crypto-js.

joshua-schwartz avatar joshua-schwartz commented on September 27, 2024 1

We were only able to resolve this issue by switching to the CryptoES library. Not sure if this one is even actively maintained anymore.

from crypto-js.

arunlals avatar arunlals commented on September 27, 2024

I can console.log(JSON.stringify(info.user)); and its working fine. See my code below.

console.log(JSON.stringify(info.user));
// var userAES = CryptoJS.AES.encrypt(JSON.stringify(info.user), 'thisisakey');

from crypto-js.

evanvosberg avatar evanvosberg commented on September 27, 2024

Pretty strange because the error message is related to the JSON.stringify().

from crypto-js.

sarahsga avatar sarahsga commented on September 27, 2024

When you
var userAES = CryptoJS.AES.encrypt(JSON.stringify(info.user), 'thisisakey');

you must not
JSON.stringify(userAES);

from crypto-js.

nhoctanker avatar nhoctanker commented on September 27, 2024

+1 we got same issue

from crypto-js.

TurningTide avatar TurningTide commented on September 27, 2024
let configString = JSON.stringify(param[key]); //fine
let encryptedString = CryptoJS.AES.encrypt(configString, 'thekey') // Converting circular structure to JSON

Same issue at september 2019 😭

from crypto-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.