Code Monkey home page Code Monkey logo

Comments (12)

ggozad avatar ggozad commented on July 26, 2024

On certain android devices (have had this with an s8 for example) for unknown reasons libscrypt gives us wrong results. @demetris-manikas had tried to figure this out with the authors of libscrypt unsuccessfully iirc.
For Crypho we ended up testing first with fast values and then using the sjcl implementation if it failed.
I would definitely appreciate more eyes on this and somebody figuring out, but cannot be of help at the moment.

from cordova-plugin-scrypt.

homakov avatar homakov commented on July 26, 2024

Can confirm that emulator is working fine... My suggestion would be to put a warning on README for the time being - s8 is quite a popular phone.

I will try to figure out.

from cordova-plugin-scrypt.

demetris-manikas avatar demetris-manikas commented on July 26, 2024

The truth is that the problem was solved by using code from another source. Details here. technion/libscrypt#39
@ggozad should we revisit this?

from cordova-plugin-scrypt.

ggozad avatar ggozad commented on July 26, 2024

Feel free to fix, I have no time to dig into this at the moment but can test and will accept a PR.

from cordova-plugin-scrypt.

demetris-manikas avatar demetris-manikas commented on July 26, 2024

@ggozad There is a branch in this project called FEAT-tarsnap which I believe you already have tested that solves the problem exactly as discussed in technion/libscrypt#39. Feel free to retest!
@homakov Could you test it as well?

from cordova-plugin-scrypt.

homakov avatar homakov commented on July 26, 2024

Have you tried to run it with phonegap? Because this never runs second alert:


phonegap create itest "itest" "itest"
cd itest
phonegap platform add ios
phonegap plugin add cordova-plugin-scrypt

insert this in index.js

setTimeout(function(){
    alert(window.plugins.scrypt)
    window.plugins.scrypt(
        function (res) { alert(key); },
        function (err) { alert(err) },
        'password', 'salt', {N: 16384}
    )

},3000)

phonegap run ios

It simply does not call success nor error callback in emulator. Will try plain cordova later.

from cordova-plugin-scrypt.

demetris-manikas avatar demetris-manikas commented on July 26, 2024

Your code has a mistake. In the success callback "key" is not defined so change it to "res" and report back. Thanks

from cordova-plugin-scrypt.

homakov avatar homakov commented on July 26, 2024

Sorry, my original code had no mistake and test was wrong. Anyway it still not working:


setTimeout(function(){
    alert(window.plugins.scrypt)
    window.plugins.scrypt(
        function (res) { alert(1); },
        function (err) { alert(2) },
        'password', 'salt', {N: 16384}
    )
},3000)

from cordova-plugin-scrypt.

homakov avatar homakov commented on July 26, 2024

And just tested same sequence with "cordova" instead of phonegap and it worked.

I can easily switch to cordova but i wonder why phonegap is failing. I have no idea how to debug this one.

from cordova-plugin-scrypt.

homakov avatar homakov commented on July 26, 2024

I've merged FEAT-tarsnap and added plugin from my repo cordova plugin add https://github.com/homakov/cordova-plugin-scrypt.git and I get 82e08... on both emulator and my s8. Good results! I will do more tests for my app (efficient scrypt is critical part of it) and thank you for your work and saving me ton of time!

from cordova-plugin-scrypt.

ggozad avatar ggozad commented on July 26, 2024

Hey, I've been sick the last few days :( Tomorrow I should be good to go to the office again and will look further into this. I need to review the changes on tarsnap but it seems the issue was the void * casts which should be resolved now.

from cordova-plugin-scrypt.

ggozad avatar ggozad commented on July 26, 2024

Fixed in 2.1.1

from cordova-plugin-scrypt.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.