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
Add a ment  | 

2 Answers 2

Reset to default 3

I 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