adjusts syntax for ruby 2.0. optimizes encryption