Examples of KeyCrypterScrypt


Examples of com.google.bitcoin.crypto.KeyCrypterScrypt

        }
    }

    public void changeWalletPassword(char[] oldUtf16Password, char[] newUtf16Password) throws WrongPasswordException {
        // check if aes key for new password can be generated before decrypting
        KeyCrypterScrypt keyCrypter = new KeyCrypterScrypt();
        KeyParameter aesKey = deriveKeyAndWipePassword(newUtf16Password, keyCrypter);

        updateLastWalletChange(wallet);

        if (isWalletEncrypted()) {
View Full Code Here

Examples of com.google.bitcoin.crypto.KeyCrypterScrypt

            wipeAesKey(oldAesKey);
        }
    }

    private void encryptWallet(char[] utf16Password, Wallet wallet) throws WrongPasswordException {
        KeyCrypterScrypt keyCrypter = new KeyCrypterScrypt();
        KeyParameter aesKey = deriveKeyAndWipePassword(utf16Password, keyCrypter);

        try {
            wallet.encrypt(keyCrypter, aesKey);
        } finally {
View Full Code Here

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

Examples of org.bitcoinj.crypto.KeyCrypterScrypt

        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

Examples of org.bitcoinj.crypto.KeyCrypterScrypt

        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
Copyright © 2018 www.massapi.com. 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.