question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
cloud8littlecommented, Jan 22, 2019

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.

1reaction
cloud8littlecommented, Jan 14, 2019

The issue still exist with version 1.0.7, i need re-open it, but it seems i was not authorized.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using ssh-keygen and sharing for key-based authentication in ...
Creating a password-protected key looks something like this: [user@host ~]$ ssh-keygen -f .ssh/key-with-password Generating public/private rsa key pair.
Read more >
How To Configure SSH Key-Based Authentication on a Linux ...
Step 1 — Creating SSH Keys. The first step to configure SSH key authentication to your server is to generate an SSH key...
Read more >
Discovery Credentials: SSH Private Key - ServiceNow
Solved: Currently, Discovery is configured to use a local account username and password for SSH to our Macs. Discovery is successful with this....
Read more >
Private key encryption (NEP-2) and Wallet files (NEP-6) | NEO ...
This encrypted key provides an additional layer of security to the raw private key, requiring an attacker to acquire both the encrypted key...
Read more >
Set up SSH public key authentication to connect to a remote ...
Log into the remote system using your account username and password. Note: If the remote system is not configured to support password-based ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found