0

I am calling a restful web service written in java from java script page and from restful web service i am returning J SON data. how can i encrypt the j son data in java so that no one can see the data using firebug and again i need to decrypt the data in java script page.
Somewhere i read about b son but i couldn't get much info about this.
Is there any way to do this.
Thanks in advance. i am making ajax call from java script like this...

$.post(url,{cache: false, "_": $.now() },function(){
            //  code
        }, "json");

and from server i am returning json data like this
objectmapper.writeValueAsString("String data");
1
  • 3
    If you're sending something to the client and anything (like your JavaScript code) can decode it, then the user can see it. Commented Apr 10, 2014 at 18:54

1 Answer 1

3

Regardless of which encryption you use between the client and the server, there must be a point for the client where the data can be read. That is in the browser, which is exposed to javascript, and therefore to Firebug.

Bson is bynary Json (http://bsonspec.org/), and, unless javascript reads and writes the stream by itself (without parsing it into a clear text object), you would fall into the same problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.