# How To Import Crypto.Cipher AES  Module Python Policy ?

**URL:** <https://discuss.google.dev/t/how-to-import-crypto-cipher-aes-module-python-policy/48734>\
**Category:** Apigee\
**Tags:** apigee-general, private-cloud-deployment, integration, api-runtime\
**Created:** [January 9, 2022, 1:01pm UTC](https://discuss.google.dev/t/how-to-import-crypto-cipher-aes-module-python-policy/48734 "2022-01-09T13:01:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [January 9, 2022, 1:01pm UTC](https://discuss.google.dev/t/how-to-import-crypto-cipher-aes-module-python-policy/48734/1 "2022-01-09T13:01:05Z")

</div>

I am trying to use AES GCM Algorithm to decrypt some data, when I am running this python script on APIGEE

Getting Error → ImportError: No module named Crypto

How can I import this module to Apigee ?

I tried to use command line but it dose not work with me

---

<div class="post-metadata">

**Author:** ![dchiesa1](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/dchiesa1/32/15641_2.png) [@dchiesa1](https://discuss.google.dev/u/dchiesa1)\
**Post date:** [January 9, 2022, 3:28pm UTC](https://discuss.google.dev/t/how-to-import-crypto-cipher-aes-module-python-policy/48734/2 "2022-01-09T15:28:37Z")

</div>

The Python you can use in a Java callout is actually Jython, which implies it’s an older Python engine and some of the modules available in current Python may not be available in the Jython layer.

Two suggestions for you.

- use an external callout. This works if you have Apigee X, OR
- use the AES callout built in Java. Available [here](https://github.com/DinoChiesa/Apigee-CustomPolicy-AesCrypto).

Good luck!

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [January 9, 2022, 5:53pm UTC](https://discuss.google.dev/t/how-to-import-crypto-cipher-aes-module-python-policy/48734/3 "2022-01-09T17:53:51Z")

</div>

Thanks very helpful ,

I am tying to use it now but I am facing a problem which is when I specify all properties it gives me Error 500 :

java.lang.IllegalStateException: missing source at com.google.apigee.callouts.AesCryptoCallout.getSourceBytes(AesCryptoCallout.java:331) at com.google.apigee.callouts.AesCryptoCallout.execute(AesCryptoCallout.java:396) at

| java.lang.IllegalStateException: missing source |
| --- |

JavaCallOut Body:

decrypt true GCM NoPadding 385f9fd4cba017c159956276036545b0 base16 mRqogt0pxtPdgyjt base64url 73XlhsvhcsaIFJUrqZFyf0Hjgxx9A-rbPWoIdsup-ScsXuqO6RevhNdjBg base64url eyJ0eXAiOiJKV1QiLCJoZHIxIjoxMjMsImVuYyI6IkExMjhHQ00iLCJoZHIyIjp0cnVlLCJhbGciOiJSU0EtT0FFUC0yNTYifQ ESdhCa\_eqd2FaI5e5IH2xQ base64url true com.google.apigee.callouts.AesCryptoCallout java://apigee-callout-aes-crypto-20211122a.jar

---

<div class="post-metadata">

**Author:** ![dchiesa1](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/dchiesa1/32/15641_2.png) [@dchiesa1](https://discuss.google.dev/u/dchiesa1)\
**Post date:** [January 9, 2022, 6:23pm UTC](https://discuss.google.dev/t/how-to-import-crypto-cipher-aes-module-python-policy/48734/4 "2022-01-09T18:23:00Z")

</div>

source must specify the name of a context variable.

Not a hard-coded ciphertext.

To use this callout, you must have a context variable that contains the ciphertext.

Check the README for details and examples.
