This repository has been archived by the owner on Dec 30, 2020. It is now read-only.
Allow Passwords as arrays of Uint8 and Salts as UTF-8 strings #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First off, thank you for this! Many years later this plugin is still coming in handy :D
Overview
I'm using Scrypt in a separate web-based client library. Prior to running passwords through the algorithm, I convert them to Array Buffers using JavaScript's charCodeAt, rather than the string's UTF-8 encoding.* Unfortunately this means this plugin is incompatible with my existing client library, unless I can pass in passwords as arrays of Uint8, just like salts.
So I implemented it!
While implementing, I also realized both passwords and salts could be implemented in the same way, and salts could therefore also accept UTF-8 strings in case anyone wanted to do that.
A note on Android installation difficulties
I used Android version 6.4.0 to test. I'm having trouble getting the plugin installed on the latest version of Android. I get conflict errors related to the .so files. At one point I got it working by removing all these source file links, but I'm tentative to mess with those considering this is my first experience with Cordova.
*I convert strings using JavaScript's charCodeAt rather than the string's UTF-8 encoding because it saves space -- I use the conversion for large inputs as well, and just reused it for password conversion which in hindsight likely wasn't the best move.