mahdiyari / hive-tx-js

Lightweight and complete JavaScript library for using Hive blockchain in Javascript environments such as Web or NodeJS.
MIT License
25 stars 12 forks source link

PrivateKey.fromLogin gives unexpected (wrong) results #5

Closed roelandp closed 3 years ago

roelandp commented 3 years ago

when calling Privatekey.fromLogin to derive keys using the seed based of account+role+master_password the returned results are not corresponding with the expected private/public keypair for the given master_password.

through trail and error I found that using the commented out Line5 in https://github.com/mahdiyari/hive-tx-js/blob/c170ec72ee8f8cd116327746d24b4f2a9e6f346a/helpers/crypto.js#L5 does give correct results so somehow the new (CryptoJS-based) implementation here goes off, at least for the PrivateKey.fromLogin expected seed-input.

I did not research any further whether the sha256-function from this helper file is used elsewhere in this convenient library, so i don't know whether simply reverting the code to the "crypto" based one would fix things or maybe trash other functionality.