Hi!
So I’m trying to import javax.crypto.* but it keeps saying that the import cannot be resolved. I’ve tried everything i’ve been able to think about. I’ve tried the other packages in javax and all seem fine, ive tried all posible ways to check if it was a spelling problem, i’ve tried substituting the processing JRE files for the ones in the latest JDK and nothing changes…
Do you need to do something else than just downloading processing to acces crypto?
By chance, have you forgotten the semicolon after the asterisk?
import javax.crypto.*
import javax.crypto.*;
Docs.Oracle.com/en/java/javase/11/docs/api/java.base/javax/crypto/package-summary.html
I wish it was that but nope:
import javax.crypto.*;
void setup() {
size(600,600);
}
void draw() {
background(0);
}```
Hey there! So this may come as odd to you but, merely using import javax.crypto.*;
or together with any of its derivatives seems to cause this problem unless used with bouncycastle
.
I’ve put an example implementation using it with the blowfish cipher algorithm. Find it here on Dropbox.
Hope you find it helpful
thanks @Abel,
but i not find your example,
only the ICE lib and the org.provider
Shoot! I forgot. Here is the example. [The above link has also been updated.]
Okay so I found out that if you copy the jce.jar in jre/lib into a folder called code in the sketch folder, it actually does import it.
Hi,
I have the same problem. Tried everything but can’t make processing import this javax.crypto
Using Processing 3.5.4 and Java 8 Update 291 (64-bit)
Any idea?
Hey hey,
Here are the libraries required (Crypto, and Base64) along with a working example.
Just make sure to copy both folders, ‘crypto’ and ‘base64’, in your ‘…/Processing/libraries/’ folder.
This shall resolve the issue.
Thanks so much for creating and sharing this, @Abel!
A note for people using these:
Both libraries are necessary for the Crypto Blowfish demo sketch to run.
-
To install crypto support that is importable by any Processing sketch, copy both folders into your Processing libraries folder:
-
crypto
→Processing/libraries/crypto
-
base64
→Processing/libraries/base64
-
-
To install crypto support for a single sketch only, copy both folders into a new folder in your sketch named
/code
.
In this example,CryptoBlowfish
is the name of your sketch:-
crypto
→CryptoBlowfish/code/crypto
-
base64
→CryptoBlowfish/code/base64
-