Skip to content

Commit

Permalink
SCrypt replaced with bouncycastle
Browse files Browse the repository at this point in the history
  • Loading branch information
dmi3coder committed Sep 2, 2017
1 parent ada4d03 commit 16ca2e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ configurations {
dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.5',
'com.github.jnr:jnr-unixsocket:0.15',
'com.lambdaworks:scrypt:1.4.0',
'com.squareup:javapoet:1.7.0',
'com.squareup.okhttp3:okhttp:3.8.1',
'com.squareup.okhttp3:logging-interceptor:3.8.1',
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/web3j/crypto/Wallet.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

import com.lambdaworks.crypto.SCrypt;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator;
import org.bouncycastle.crypto.generators.SCrypt;
import org.bouncycastle.crypto.params.KeyParameter;

import org.web3j.utils.Numeric;
Expand Down Expand Up @@ -132,11 +132,7 @@ private static WalletFile createWalletFile(

private static byte[] generateDerivedScryptKey(
byte[] password, byte[] salt, int n, int r, int p, int dkLen) throws CipherException {
try {
return SCrypt.scrypt(password, salt, n, r, p, dkLen);
} catch (GeneralSecurityException e) {
throw new CipherException(e);
}
return SCrypt.generate(password, salt, n, r, p, dkLen);
}

private static byte[] generateAes128CtrDerivedKey(
Expand Down

0 comments on commit 16ca2e8

Please sign in to comment.