From: "Fa D." Date: 2013-04-13T19:39:24+09:00 Subject: AES ECB : OpenSSL::Cipher::CipherError: wrong final block length Hi guys, First hello to everyone. My name is Fabio, and I'm from Portugal. First post here. I'm trying to implement a security measure whose specs where create my portuguese treasury department. They don't specify an IV (Initial Vector) because ECB does not need it. I need to cipher a string with AES+ECB+PKC5Padding. The code is: require 'openssl' require 'base64' data = "my message" cipher = OpenSSL::Cipher.new('AES-128-ECB') key = cipher.random_key() cipher.key = key encrypted = cipher.update(data) + cipher.final The error: OpenSSL::Cipher::CipherError: wrong final block length What's missing here? What am i doing wrong? Regards Fabio -- Posted via http://www.ruby-forum.com/.