The following function works perfect in PHP. How can it be translated in Ruby on Rails.
Please note that both privateKey and iv are 32 characters long.
m
You are base64 decoding it in the php example. Are you doing that in the ruby one as well?
require "base64" Base64.decode64(encrypted)
Other than that, the code looks right to me.