CipherException when creating a password-protected account (NEP-2) based on a key pair
See original GitHub issue WalletFile wallet = Wallet.createStandardWallet(); ECKeyPair ecKeyPair1 = Keys.createEcKeyPair(); WalletFile.Account account = Wallet.createStandardAccount("myPassw0rd!@#", ecKeyPair1);
Exception in thread “main” io.neow3j.crypto.exceptions.CipherException: Error performing cipher operation at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:172) at io.neow3j.crypto.Wallet.encrypt(Wallet.java:124) at io.neow3j.crypto.Wallet.createAccount(Wallet.java:59) at io.neow3j.crypto.Wallet.createStandardAccount(Wallet.java:75) at Main.main(Main.java:145) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.security.InvalidKeyException: Illegal key size or default parameters at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026) at javax.crypto.Cipher.implInit(Cipher.java:801) at javax.crypto.Cipher.chooseProvider(Cipher.java:864) at javax.crypto.Cipher.init(Cipher.java:1249) at javax.crypto.Cipher.init(Cipher.java:1186) at io.neow3j.crypto.Wallet.performCipherOperation(Wallet.java:167) … 9 more
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
It turns out to be the problem of the jurisdiction (China), solution(remove the key size restriction): https://www.andreafortuna.org/programming/java-tips-how-to-fix-the-invalidkeyexception-illegal-key-size-or-default-parameters-runtime/, @gsmachado this issue can be closed now.
The issue still exist with version 1.0.7, i need re-open it, but it seems i was not authorized.