简体   繁体   中英

Hybrid Cryptography in hybrid mobile application

I would like to implement Hybrid cryptography in client side using javascript. I found this tutorial for server side coding. Now i'm done with server side part, but stuck in client side development. Whether there is any pre-build cordova / javascript lib available for this ? I'm using sencha touch framework for front end development.

You can use https://github.com/brix/crypto-js

for client side data decryption.

However, when sending response back to client side, you will have to combine encrypted data + encrypted key in single response with some kind of separator and retrieve same at client side and then decrypt them. One simple practice I can suggest is to send response in following JSON format:

{
  data: encrypted_data_with_dynamically_generated_key,
  key: dynamically_generated_key_encrypted_with_client_private_key
}

With this you won't require to put data separator to get key and data from data.

Additionally, if you want another layer of security to store client key securely, you can use following cordova plugin: https://github.com/Crypho/cordova-plugin-secure-storage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM