Git Product home page Git Product logo

bip39's People

Contributors

westonal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bip39's Issues

Validate a list of indexes

We already do this, if the client has the words chosen from the dictionary and can provide the indexes into the dictionary, it would save client combining, then library normalizing, splitting to a list, and finding the indexes. Plus it would avoid the client handling WordNotFoundException and UnexpectedWhiteSpaceException.

NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA512 implementation not found

On Android < 26

Caused by: java.lang.RuntimeException: java.security.NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA512 implementation not found
                                                                                at io.github.novacrypto.toruntime.CheckedExceptionToRuntime.toRuntime(CheckedExceptionToRuntime.java:48)
                                                                                at io.github.novacrypto.bip39.SeedCalculator.getPbkdf2WithHmacSHA512(SeedCalculator.java:91)
                                                                                at io.github.novacrypto.bip39.SeedCalculator.<init>(SeedCalculator.java:40)

See: https://developer.android.com/reference/javax/crypto/SecretKeyFactory.html

calculateSeed should take CharSequence

 public byte[] calculateSeed(String mnemonic, String passphrase) {

This should be able to take CharSequence but the normalizer is insisting we have String input.

why use createMnemonic get 24 word

when i use
f=fc534ee49d7d44f7942996f13ba11372f939e5fcc02dd89eb4fdd23e4dcdb134

 new MnemonicGenerator(wordList)
                .createMnemonic(f, sb::append);

i got "wisdom omit rice depend stairs knock expose crazy van tackle dynamic tourist near very vessel aisle sudden volcano disorder piece tooth traffic shadow mother" total 24 words,

i wannn 12 word. like METAMASK

thank you

Missing Sha256 class

I tried the example "Using a StringBuilder" and got "Exception in thread "main" java.lang.NoClassDefFoundError: io/github/novacrypto/hashing/Sha256".
MnemonicGenerator has an import of io.github.novacrypto.hashing.Sha256, but there is no such package as io.github.novacrypto.hashing.

I encountered a problem that different derived paths get different addresses

Hello, I am very happy to use your powerful encryption library, but when I was testing the demo example on this page (https://iancoleman.io/bip39/#english), I encountered a problem: From Derived Addresses Title,
In the Table tab , how to generate different addresses, public keys, and private keys according to different Derived Paths. When I use the BIP39 library, I don’t know how to implement it. cloud you give me a java demo? Because the page is implemented through the javascript lib, but how to implement the java BIP39 library, I read all the unit tests and don’t know how to write the code, so I need your help. thanks!

link:
https://github.com/NovaCrypto/BIP39
https://iancoleman.io/bip39/#english

Simplify validate

The method for splitting the string and looking up the words can be simplified.

Error encounter ->lass io.github.novacrypto.hashing.Sha256$1 cannot access its superinterface io.github.novacrypto.toruntime.CheckedExceptionToRuntime$Func

JDK1.8.0_121
Intellij IDEA
Without Andriod development environment
class io.github.novacrypto.hashing.Sha256$1 cannot access its superinterface io.github.novacrypto.toruntime.CheckedExceptionToRuntime$Func at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at io.github.novacrypto.hashing.Sha256.sha256(Sha256.java:57) at io.github.novacrypto.hashing.Sha256.sha256(Sha256.java:40) at io.github.novacrypto.hashing.Sha256.sha256(Sha256.java:36) at io.github.novacrypto.bip39.MnemonicGenerator.firstByteOfSha256(MnemonicGenerator.java:120) at io.github.novacrypto.bip39.MnemonicGenerator.wordIndexes(MnemonicGenerator.java:104) at io.github.novacrypto.bip39.MnemonicGenerator.createMnemonic(MnemonicGenerator.java:81)

Misleading PRF name gives code review heart attack

Quoting BIP 39:

HMAC-SHA512 is used as the pseudo-random function.

Quoting SeedCalculator.java:38:

    private final PBKDF2WithHmacSHA256 hashAlgorithm;

    public SeedCalculator(PBKDF2WithHmacSHA256 hashAlgorithm) {
        this.hashAlgorithm = hashAlgorithm;
}

On a two-minute glance through the code, I had an understandable reaction. Then, I reached for grep and found these:

JavaxPBKDF2WithHmacSHA256.java:36:

public enum JavaxPBKDF2WithHmacSHA256 implements PBKDF2WithHmacSHA256 {
    INSTANCE;

    private SecretKeyFactory skf = getPbkdf2WithHmacSHA512();

    @Override
    public byte[] hash(char[] chars, byte[] salt) {
        final PBEKeySpec spec = new PBEKeySpec(chars, salt, 2048, 512);

SpongyCastlePBKDF2WithHmacSHA256.java:32:

public enum SpongyCastlePBKDF2WithHmacSHA256 implements PBKDF2WithHmacSHA256 {
    INSTANCE;

    @Override
    public byte[] hash(char[] chars, byte[] salt) {
        PKCS5S2ParametersGenerator generator = new PKCS5S2ParametersGenerator(new SHA512Digest());

I am still not sure how it all fits together. But I suggest it may be kinder to code reviewers to not misidentify the PRF in variable names. Or perhaps you wish to test whether readers be paying attention? [g]

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.