2

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!

fadelakin
  • 3,763
  • 4
  • 19
  • 20
  • 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 Apr 09 '14 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 Apr 09 '14 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 Apr 09 '14 at 20:40

2 Answers2

2

I think that only way it can be done is WebView. Maybe this will give you some lead.

Android WebView Javascript from assets

Community
  • 1
  • 1
1

To achieve your goal, you can use this library for running JavaScript in Android apps.

Oleg Sokolov
  • 1,134
  • 1
  • 12
  • 19