# Logstash cipher filter issue

**URL:** https://discuss.elastic.co/t/logstash-cipher-filter-issue/185549
**Category:** Logstash
**Created:** [June 13, 2019, 6:36am UTC](https://discuss.elastic.co/t/logstash-cipher-filter-issue/185549 "2019-06-13T06:36:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yogender20](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yogender20/32/60834_2.png) [@yogender20](https://discuss.elastic.co/u/yogender20)
#### Post date: [June 13, 2019, 6:36am UTC](https://discuss.elastic.co/t/logstash-cipher-filter-issue/185549/1 "2019-06-13T06:36:06Z")

</div>

Hello,

I'm encrypting some data using logstash cipher filter & store the encrypted data in elasticsearch. The code snippet used for the encryption is as follow:  
filter {  
cipher {  
algorithm =\> "aes-256-cbc"  
cipher\_padding =\> 1  
iv\_random\_length =\> 16  
key =\> "\<32\_DIGITS\_KEY\>"  
key\_size =\> 32  
mode =\> "encrypt"  
source =\> "[message]"  
target =\> "[message\_enc]"  
}  
}

When I read the data from this elasticsearch index using java code & decrypt it then I'm getting same random unicode string before my actual data. Sample random string is "r��1�\>\<��B9c�M\*\*\<MY\_STRING\>\*\*"

I didn't find anything in my code to resolve this issue.

Please help me in resolving this.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 11, 2019, 9:05am UTC](https://discuss.elastic.co/t/logstash-cipher-filter-issue/185549/3 "2019-07-11T09:05:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
