简体   繁体   English

混合密码学在混合移动应用中的应用

[英]Hybrid Cryptography in hybrid mobile application

I would like to implement Hybrid cryptography in client side using javascript. 我想使用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 ? 是否为此提供了任何预构建的cordova / javascript库? I'm using sencha touch framework for front end development. 我正在使用sencha touch框架进行前端开发。

You can use https://github.com/brix/crypto-js 您可以使用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: 我可以建议的一种简单做法是,以以下JSON格式发送响应:

{
  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 此外,如果希望另一安全层安全地存储客户端密钥,则可以使用以下cordova插件: https : //github.com/Crypho/cordova-plugin-secure-storage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在混合移动应用程序中启用了拼写检查 - Spellcheck enabled in Hybrid Mobile application 混合移动应用程序中的XMLHttpRequest异常101 - XMLHttpRequest Exception 101 in hybrid mobile application Google Maps在混合移动应用程序中缓存切片 - Google Maps caching tiles in hybrid mobile application 混合移动应用 - Hybrid mobile apps 如何使用Cordova处理混合移动应用程序的后退按钮功能 - How to handle the back button functionality for Hybrid mobile application using cordova 如何在 Ionic For Hybrid Mobile Application 中添加多个 HTML 页面? - How to add multiple HTML pages in Ionic For Hybrid Mobile Application? Chardin Js,混合Cordova移动应用程序-“未定义”不是一个功能 - Chardin Js , Hybrid Cordova mobile application - “undefined” is not a function 混合移动应用程序在添加cordova.js时崩溃 - Hybrid mobile application crash while adding cordova.js 在 Hybrid 移动应用中使用 VueJs 实现谷歌地点 - Implementation of google places using VueJs in Hybrid mobile application 苹果商店准则。 混合移动应用程序中的外部JavaScript文件 - Apple Store Guidelines. External JavaScript files in hybrid mobile application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM