# Logstash fails at logstash-filter-cipher plugin

**URL:** <https://discuss.elastic.co/t/logstash-fails-at-logstash-filter-cipher-plugin/63176>\
**Category:** Logstash\
**Created:** [October 17, 2016, 9:58am UTC](https://discuss.elastic.co/t/logstash-fails-at-logstash-filter-cipher-plugin/63176 "2016-10-17T09:58:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anandpathak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandpathak/32/12535_2.png) [@anandpathak](https://discuss.elastic.co/u/anandpathak)\
**Post date:** [October 17, 2016, 9:58am UTC](https://discuss.elastic.co/t/logstash-fails-at-logstash-filter-cipher-plugin/63176/1 "2016-10-17T09:58:01Z")

</div>

Hi,  
I am using logstash : 2.2.4 and logstash-filter-cipher : 2.0.5 on linux ubuntu 14.04. I am taking input from kafka and filtering it with cipher plugin where I am decrypting message which is encrypted using aes-128-cbc, but logstash halts at cipher after handling few messages.  
Here is the logstash file  
`bin/logstash -e 'input { kafka {topic_id => "random" zk_connect => "" codec => "plain" } } filter { cipher { algorithm => "aes-128-cbc" key =>"<key>" key_size => xx mode => "decrypt" base64 => true iv=> "ivString" }} output {stdout{codec => rubydebug}}'`

Here is the output I am getting

`OpenSSL::Cipher::CipherError: key not specified reset at org/jruby/ext/openssl/Cipher.java:933 init_cipher at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-cipher-2.0.5/lib/logstash/filters/cipher.rb:217 filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-cipher-2.0.5/lib/logstash/filters/cipher.rb:208 multi_filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.4-java/lib/logstash/filters/base.rb:151 each at org/jruby/RubyArray.java:1613 multi_filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.4-java/lib/logstash/filters/base.rb:148 filter_func at (eval):41 filter_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.4-java/lib/logstash/pipeline.rb:259 each at org/jruby/RubyArray.java:1613 inject at org/jruby/RubyEnumerable.java:852 filter_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.4-java/lib/logstash/pipeline.rb:257 worker_loop at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.4-java/lib/logstash/pipeline.rb:215 start_workers at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.4-java/lib/logstash/pipeline.rb:193`

it is a bug or am I doing anything wrong ?

---

<div class="post-metadata">

**Author:** ![anandpathak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandpathak/32/12535_2.png) [@anandpathak](https://discuss.elastic.co/u/anandpathak)\
**Post date:** [October 18, 2016, 6:01am UTC](https://discuss.elastic.co/t/logstash-fails-at-logstash-filter-cipher-plugin/63176/2 "2016-10-18T06:01:05Z")

</div>

There was multiple thread to handle multiple input in logstash, each input thread was trying to access same cipher resource which caused this problem. This problem is already discussed at [https://github.com/logstash-plugins/logstash-filter-cipher/issues/10](https://github.com/logstash-plugins/logstash-filter-cipher/issues/10) and now its solved by adding mutex around the resources.

---

<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 6, 2017, 4:33am UTC](https://discuss.elastic.co/t/logstash-fails-at-logstash-filter-cipher-plugin/63176/3 "2017-07-06T04:33:49Z")

</div>


