Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:36:06+00:00 2026-06-11T22:36:06+00:00

I have an array of JSON arrays whose values I am trying to encrypt

  • 0

I have an array of JSON arrays whose values I am trying to encrypt with CryptoJS and then print for use in another file, where these values should be decrypted using a user-given passphrase.

But I am doing something wrong and I am getting “Uncaught Error: Malformed UTF-8 data” when decrypting the URL’s.

encrypt.js:

var encrypted = CryptoJS.AES.encrypt(item[key], pass);
json[j] += encrypted.ciphertext.toString(CryptoJS.enc.Base64);

decrypt.js:

var decrypted = CryptoJS.AES.decrypt(item[key], pass);
html += '<a href="' + decrypted.toString(CryptoJS.enc.Utf8) + '" target="_blank" class="socialico ' + key + '">' + icons[key] + '</a>';

I followed this example… Help, pretty please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:36:08+00:00Added an answer on June 11, 2026 at 10:36 pm

    That error message usually means the data wasn’t decrypted correctly, and the resulting plaintext bytes don’t form valid UTF-8 characters.

    A couple things to check:

    • First, make sure you’re using the same password for both encryption and decryption. You may want to keep a hash of the correct password so that you can verify if the user gave the correct password before you use it for decryption.
    • Second, make sure that the value item[key] is a string before encrypting. CryptoJS can’t encrypt JSON objects. You’ll have to serialize it first.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP file that returns a JSON array. I need to extract
I have a tableview whose contents are generated with json array. It also employes
I have 3 json arrays, each with information listed in the same format: Array:
My problem: I have an JSON Array containing arrays, which i render into the
I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
I have a JSON array like below: var jsonArray = [{k1:v1},{k2:v2},{k3:v3},{k4:v4},{k5:v5}] I don't know
I have two arrays in JSON something like: proj1 proj1 taska taska charge1 charge1
I have an array of json objects like so: [{a:b},{c:d},{e:f}] What is the best
I have some troubles mapping a JSON Array to RestKit. This is what the
I have something like a json array output, it comes like : { data:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.