admin管理员组文章数量:1384349
I want to use the SJCL library in an Android app that I'm building. The thing is SJCL is a javascript crypto library. I'm new to Android development and I was wondering how I could go about using the library in my project.
What I'm looking to do is hash a person's username and password and decrypt whatever response I get from the server which is why I want to use SJCL. If anyone has any insight into how to do this, that'd be great!
I want to use the SJCL library in an Android app that I'm building. The thing is SJCL is a javascript crypto library. I'm new to Android development and I was wondering how I could go about using the library in my project.
What I'm looking to do is hash a person's username and password and decrypt whatever response I get from the server which is why I want to use SJCL. If anyone has any insight into how to do this, that'd be great!
Share Improve this question asked Apr 9, 2014 at 20:14 fadelakinfadelakin 3,8434 gold badges20 silver badges20 bronze badges 3- Can't you use a Java library for this? Either way, you should probably be using TLS (e.g. https) rather than rolling your own protocol. – ntoskrnl Commented Apr 9, 2014 at 20:27
- @ntoskrnl I'm not rolling my own protocol. I'm building an app for a service. The API documentation requires me to implement a login system that is hashed. The iOS app for the service uses SJCL but they don't have an Android app I could look at which is why I'm trying to figure it it out. The username and password are hashed and then sent to the server which unhashes it and sends back a blob of data which is basically info about the user. – fadelakin Commented Apr 9, 2014 at 20:30
- Hashing is a one-way operation that cannot be undone. But fair enough. Perhaps they have documented the system so that you can implement it in Java? If all else fails, you could read the JS code and rewrite it in Java. – ntoskrnl Commented Apr 9, 2014 at 20:40
2 Answers
Reset to default 3I think that only way it can be done is WebView. Maybe this will give you some lead.
Android WebView Javascript from assets
To achieve your goal, you can use this library for running JavaScript in Android apps.
本文标签: javaUse JavaScript Library in Android ApplicationStack Overflow
版权声明:本文标题:java - Use JavaScript Library in Android Application - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744463498a2607374.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论