Coder Social home page Coder Social logo

Comments (13)

cermakcz avatar cermakcz commented on June 14, 2024 2

Hey @scottyab, I started looking into it and so far it seems that the best way to do it would be creating another constructor which would take AesCbcWithIntegrity.SecretKeys instead of the password. Plus, it'd be nice to add another method to AesCbcWithIntegrity, namely generateKeyFromPassword(String password, String salt, int iterationCount, int keyLength), which would allow easy creation of the SecreyKeys with whatever strenght the user wants. But I'm not sure if it wouldn't violate the purpose of the library - providing simple and secure encryption. What do you think?

from secure-preferences.

scottyab avatar scottyab commented on June 14, 2024 1

Great minds think alike 👍 , I've just added a new constructor to take AesCbcWithIntegrity.SecretKeys and I'm just writing a unit test for it (before pushing). As for the changes to 'AesCbcWithIntegrity', personally it makes sense, it just gives more options the default are still stronger.

from secure-preferences.

scottyab avatar scottyab commented on June 14, 2024

wow, 3 seconds, i didn't know it was that long. Maybe some kind of lite mode option would suitable or as you suggest providing own key could be good. I'll review that post.

from secure-preferences.

scottyab avatar scottyab commented on June 14, 2024

Hey @cermakcz Confirmed. I'm seeing init time of 4.4s on nexus 4. Let's make suppling your own key an enhancement. I'd welcome PR if you have time, otherwise I'd add to my todo.

from secure-preferences.

cermakcz avatar cermakcz commented on June 14, 2024

Thanks for the change, I just started working on it when I read that you've already done it :) I'll go and see if there's something I can do about the AesCbcWithIntegrity change.

Edit: pull request here: tozny/java-aes-crypto#12

from secure-preferences.

scottyab avatar scottyab commented on June 14, 2024

Thanks for that. Hoping @tozny is ok with and can merge the PR. I'll pull once accepted. In Secure Preferences I'm actually using my fork of java-aes-crypto as wanted to reference the dependancy from maven central.

from secure-preferences.

cermakcz avatar cermakcz commented on June 14, 2024

Yeah I noticed. That's why I was hoping you'd pull it to your fork and make a new version, like you said.

from secure-preferences.

scottyab avatar scottyab commented on June 14, 2024

@cermakcz i've pulled your fork of java-aes-crypto into my fork added unit test and published as 0.0.3. Just waiting on maven central to propagate, then I'll release a new version of secure prefs 0.1.3 dependent on com.scottyab:aes-crypto:0.0.3

from secure-preferences.

cermakcz avatar cermakcz commented on June 14, 2024

@scottyab Cool, thanks.

from secure-preferences.

scottyab avatar scottyab commented on June 14, 2024

Fixed in 0.1.3 (once propagated to maven central)

Example...

AesCbcWithIntegrity.SecretKeys myKey = AesCbcWithIntegrity.generateKeyFromPassword(Build.SERIAL,AesCbcWithIntegrity.generateSalt(),1000);
            SharedPreferences securePrefs1000 = new SecurePreferences(this, myKey, "my_prefs_1000.xml");

from secure-preferences.

mkaarthick avatar mkaarthick commented on June 14, 2024

Hi, i tried using password, but still app lags.

from secure-preferences.

scottyab avatar scottyab commented on June 14, 2024

@mkaarthick I'm not sure I understand your comment. You can manually pass in your own keys created with generateKeyFromPassword method that takes a int of the iterationCount. To increase the speed (but reduce security) you can lower the iterationCount (default 10,000).

AesCbcWithIntegrity.SecretKeys mykeys = AesCbcWithIntegrity.generateKeyFromPassword(password, salt, iterationCount);
SecurePreferences securePrefs = new SecurePreferences(getContext(), mykeys, "pref-file");

from secure-preferences.

ShinJJang avatar ShinJJang commented on June 14, 2024

handlePasswordChange() also need iteration count parameter. All method is private static, so I can't override. If to find method not to build library, the only way is inheritance with SecurePreference and overwrite method handlePasswordChange(). But, this is not cool.

from secure-preferences.

Related Issues (20)

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.