Skip to content
This repository was 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

Open
j-berman wants to merge 2 commits intoCrypho:masterfrom
j-berman:master
Open

Allow Passwords as arrays of Uint8 and Salts as UTF-8 strings#10
j-berman wants to merge 2 commits intoCrypho:masterfrom
j-berman:master

Conversation

@j-berman
Copy link
Copy Markdown

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.

- "Historically the NDK supported ARMv5 (armeabi), and 32-bit and 64-bit MIPS, but support for these ABIs was removed in NDK r17." (https://developer.android.com/ndk/guides/abis#sa)
@ggozad
Copy link
Copy Markdown
Contributor

ggozad commented Dec 30, 2020

Hey,
Thanks so much for the kind words and contribution. Unfortunately I've stoped maintenance of the plugin a long time ago, but forgot to update the docs. I will now archive this repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants