# Javax.crypto not resolving

**URL:** <https://discourse.processing.org/t/javax-crypto-not-resolving/8708>\
**Category:** Beginners\
**Created:** [February 25, 2019, 1:00am UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708 "2019-02-25T01:00:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlosmarcab](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@Carlosmarcab](https://discourse.processing.org/u/Carlosmarcab)\
**Post date:** [February 25, 2019, 1:00am UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/1 "2019-02-25T01:00:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [February 25, 2019, 5:34am UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/2 "2019-02-25T05:34:55Z")

</div>

> [@Carlosmarcab](#):
>
> So I’m trying to `import javax.crypto.*` but it keeps saying that the `import` cannot be resolved.

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](http://Docs.Oracle.com/en/java/javase/11/docs/api/java.base/javax/crypto/package-summary.html)

---

<div class="post-metadata">

**Author:** ![Carlosmarcab](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@Carlosmarcab](https://discourse.processing.org/u/Carlosmarcab)\
**Post date:** [February 25, 2019, 6:54am UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/3 "2019-02-25T06:54:44Z")

</div>

I wish it was that but nope:

````auto
import javax.crypto.*;

void setup() {
  size(600,600);
}

void draw() {
  background(0);
}```
````

---

<div class="post-metadata">

**Author:** ![Abel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/abel/32/3289_2.png) [@Abel](https://discourse.processing.org/u/Abel)\
**Post date:** [February 26, 2019, 6:22am UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/4 "2019-02-26T06:22:45Z")

</div>

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](https://www.dropbox.com/sh/th3t5bisof2a6cm/AAC3FsfqS9vIzcT9OLv9i_mra?dl=0) on Dropbox.

Hope you find it helpful 🤗

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [February 26, 2019, 8:01am UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/5 "2019-02-26T08:01:08Z")

</div>

thanks @Abel,  
but i not find your example,  
only the ICE lib and the org.provider

---

<div class="post-metadata">

**Author:** ![Abel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/abel/32/3289_2.png) [@Abel](https://discourse.processing.org/u/Abel)\
**Post date:** [February 26, 2019, 8:35am UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/6 "2019-02-26T08:35:15Z")

</div>

🙈 Shoot! I forgot. Here is the [example](https://www.dropbox.com/sh/zx1vf0x2in4jgiv/AAB4O-TB5DuD2Pz8d3J_DW-ta?dl=0). _[The above link has also been updated.]_

---

<div class="post-metadata">

**Author:** ![Carlosmarcab](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@Carlosmarcab](https://discourse.processing.org/u/Carlosmarcab)\
**Post date:** [February 26, 2019, 6:32pm UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/7 "2019-02-26T18:32:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shuptuu](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@shuptuu](https://discourse.processing.org/u/shuptuu)\
**Post date:** [June 24, 2021, 8:35pm UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/8 "2021-06-24T20:35:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Abel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/abel/32/3289_2.png) [@Abel](https://discourse.processing.org/u/Abel)\
**Post date:** [July 14, 2021, 12:46pm UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/9 "2021-07-14T12:46:05Z")

</div>

👋 Hey hey,

**[Here](https://github.com/AbelWondafrash/PDE/tree/main/Crypto%20Blowfish/libraries)** 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.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [August 19, 2021, 4:30pm UTC](https://discourse.processing.org/t/javax-crypto-not-resolving/8708/10 "2021-08-19T16:30:24Z")

</div>

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.

1. To install crypto support that is importable by any Processing sketch, copy both folders into your Processing libraries folder:

2. 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:
