From: "David D." Date: 2013-05-25T04:00:17+09:00 Subject: Re: why first 16 bytes are wrong with ruby openssl aes 128 cbc ? Thank Ryan I have the response my ruby code is wrong. The good code is here : require 'openssl' c = OpenSSL::Cipher::Cipher.new("aes-128-cbc") c.decrypt c.key = "7ffb8032dff33aef9aa92e9ac96239d3".unpack('H*').to_s.unpack('a2'*16).map{|x| x.hex}.pack('c'*16) c.iv = "00000000000000000000000000000001".unpack('H*').to_s.unpack('a2'*16).map{|x| x.hex}.pack('c'*16) data = File.read("/tmp/file_enc") d = c.update(data) d << c.final file = File.open("/tmp/file_decrypt_ruby", "w") file.write(d) file.close This code work very well. -- Posted via http://www.ruby-forum.com/.