javascript - Ways to Encrypt and decrypt array in jquery -


i completly new jquery , client side programing. trying figure out way of achiving this:

  1. on client side have hidden user id/profile id, wanna encrypt, while manipulating hidden value, have decrypt , perform operation on it.

  2. i have global array of arrays below:

    var users=[{"u_id":"1234", "u_name":"test"},{"u_id":"12345", "u_name":"test1"}]; 

this array used various other compoenets, e.g. when user mouse-over on profile-id, details above array , display result him.

in short, want encrypt/decrypt global variables inside script.

any plugin or ways highly appricated.

@deceze: yes exactly, example have posted, lets user 42, trying update age, basicaly user see 42 profile id when logsin, , subsequent call make changes need pass sessionkey/apikey along profile id , data, if suggest me how can manage these sessionkey/apikey, user/hacker outside can't missuse.. – jayaram pradhan 1 min ago

it's pretty simple:

  1. require users logged in via regular login mechanism, typically involving session id. session identifies user securely it's feasible securely on web. security focus must here.
  2. knowing user is, can validate , of actions. if user requests change profile information of user, check whether he's allowed or not. no api key or needed. server receives request change, server knows requesting user session, server can decide accept or reject request.

    • in concrete case of updating one's own profile, if user allowed update profile , profile alone: there needs 1 action/url, when user posts data action, server knows user , updates user's profile. user doesn't need submit user id of profile wants update, in fact can't submit user id, profile ever updated. there's no publicly accessible action allows him update else's profile.
  3. there no 3.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -