Encrypt json data with secret key on IOS and decrypt it with node js -
i need protect api csrf on post , put requests.
to that, think mobile device (example ios) need send api server (node.js) token. token must encrypted , contain json
data decrypted server side.
to decrypt data, mobile device use same secret key sever know.
for example : {_csrf: 123456789}
decrypted token sent via mobile device , checked api if match.
is right way ? if not right way ?
how can encrypt jon data on ios , decrypt on node.js ? (jwt token not have library ios)
can provide me example code encrypt data on ios et decrypt on node.js ?
just use https, encrypts everything, query string.
the content encrypted random symmetric key , key encrypted asymmetric key certificate. additionally symmetric key has short lifetime. additionally not have implements , encryption routines.
also note ios9 default require https used connections, http connections need white-listed in plist.
if own encryption have problem sharing encryption key between device , server. not easy problem solve.
Comments
Post a Comment