Creating a SagePay Encryption in Ruby

A SagePay encryption for Ruby that some folk might find useful

Iโ€™ve just had to create SagePay encryption in Ruby that isnโ€™t well documented anywhere, eventually found an old broken gem that I was able to use for parts. Thought someone might find it useful!

  def self.encrypt(input, password)
    cipher ='AES-128-CBC')
    cipher.key = password
    cipher.iv = password

    result = cipher.update(input) +


Recent posts View all


How to ignore Bullet in RSpec tests

Using Bullet during a test can pick up mistakes but also has false negatives; here is an easy way to ignore them


How we used Nokogiri to fix a sizing issue in YouTube's oEmbed

At some point, one of our calls to YouTube's oEmbed endpoint was returning videos way too small; we fixed in in our Rails application by using Nokogiri