Package org.bitcoinj.crypto

Examples of org.bitcoinj.crypto.KeyCrypterScrypt


        fadeOut(buttonHBox);

        // Figure out how fast this computer can scrypt. We do it on the UI thread because the delay should be small
        // and so we don't really care about blocking here.
        IdealPasswordParameters params = new IdealPasswordParameters(password);
        KeyCrypterScrypt scrypt = new KeyCrypterScrypt(params.realIterations);
        // Write the target time to the wallet so we can make the progress bar work when entering the password.
        WalletPasswordController.setTargetTime(params.realTargetTime);

        // Deriving the actual key runs on a background thread.
        KeyDerivationTasks tasks = new KeyDerivationTasks(scrypt, password, params.realTargetTime) {
View Full Code Here


        public IdealPasswordParameters(String password) {
            final int targetTimeMsec = 2000;

            int iterations = 16384;
            KeyCrypterScrypt scrypt = new KeyCrypterScrypt(iterations);
            long now = System.currentTimeMillis();
            scrypt.deriveKey(password);
            long time = System.currentTimeMillis() - now;
            log.info("Initial iterations took {} msec", time);

            // N can only be a power of two, so we keep shifting both iterations and doubling time taken
            // until we are in sorta the right general area.
View Full Code Here

        if (password.isEmpty() || password.length() < 4) {
            informationalAlert("Bad password", "The password you entered is empty or too short.");
            return;
        }

        final KeyCrypterScrypt keyCrypter = (KeyCrypterScrypt) Main.bitcoin.wallet().getKeyCrypter();
        checkNotNull(keyCrypter);   // We should never arrive at this GUI if the wallet isn't actually encrypted.
        KeyDerivationTasks tasks = new KeyDerivationTasks(keyCrypter, password, getTargetTime()) {
            @Override
            protected void onFinish(KeyParameter aesKey) {
                super.onFinish(aesKey);
View Full Code Here

TOP

Related Classes of org.bitcoinj.crypto.KeyCrypterScrypt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.