# Encryption and decryption using AES 256 bit CBC model

**URL:** <https://community.automationedge.com/t/encryption-and-decryption-using-aes-256-bit-cbc-model/10225>\
**Category:** Process Studio\
**Tags:** rpa, process-studio, generic, ps-steps\
**Created:** [July 24, 2023, 11:39am UTC](https://community.automationedge.com/t/encryption-and-decryption-using-aes-256-bit-cbc-model/10225 "2023-07-24T11:39:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarun\_Gandhi](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@Tarun\_Gandhi](https://community.automationedge.com/u/Tarun_Gandhi)\
**Post date:** [July 24, 2023, 11:39am UTC](https://community.automationedge.com/t/encryption-and-decryption-using-aes-256-bit-cbc-model/10225/1 "2023-07-24T11:39:15Z")

</div>

I tried different ways, have listed them below -

1. 

For encryption I tried using symmetric cryptography step but In the model that I’m using we will have a key and initialization vector as well. But I don’t see the option to pass Initialization vector in the step.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/2X/9/901cafd6717954708cbbbc9735bd1800ed693d17.png)

Even in secret key generator step I have checked if we are combining the initialization vector and the secret key earlier but noticed that we can only create a AES key and not use it with initialization vector.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/2X/3/3686eebb6c7e55e0399fbf98237062f320ada9af.png)

1. 

I was informed that I can perform this by using User defined java class, but not sure how I would implement it after preparing the Jar file and adding it to the library how will I access it User defined java class.

So I would like to know if I have missed anything in the 1st approach that I have tried and there is a way to perform this using that approach. Also how I would implement it if I was going with the second with jar file and user defined java class.

---

<div class="post-metadata">

**Author:** ![Jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jane](https://community.automationedge.com/u/Jane)\
**Post date:** [July 26, 2023, 6:30am UTC](https://community.automationedge.com/t/encryption-and-decryption-using-aes-256-bit-cbc-model/10225/3 "2023-07-26T06:30:52Z")

</div>

Hi! Tarun

For the first approach can you use the symmetric-key cryptography step twice in parallel.

---

<div class="post-metadata">

**Author:** ![Tarun\_Gandhi](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@Tarun\_Gandhi](https://community.automationedge.com/u/Tarun_Gandhi)\
**Post date:** [July 28, 2023, 11:32am UTC](https://community.automationedge.com/t/encryption-and-decryption-using-aes-256-bit-cbc-model/10225/4 "2023-07-28T11:32:29Z")

</div>

I found a solution through user defined java class at the end.  
I’m not able to use the step since the key which I’m provided with is of 2 parts. one is a 256bit key and another a initialization vector of 128 bit which I require to encrypt and decrypt the data.

I’m trying to perform AES 256 bits CBC model for cryptography.
