I have a json object that has encrypted values, I'll simplify this and pretend all values are numbers and i need the number x3 for this question. Is there a way to loop through the json object and update every value then return a decrypted version of the original object:
var encrypted = {
a: 10,
b: 4,
c: {x:3, y:2, z:1},
}
var decrypted = decryptJSON(encrypted) //<--- looking for this function
//decrypted = {
// a: 30,
// b: 12,
// c: {x:9, y:6, z:3},
// }
I've tried looping through the object using something like https://stackoverflow.com/a/29516227/620723 but this would only really work for a non nested json object.
Also the example I gave above is only nested one level in reality i may have nests inside nests inside nest inside....