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


Optionally creating or removing a column or table with Rails migrations

Here's how to go about creating or removing a column optionally using Rails migrations


Using Faker with Rails

A guide to setting up Faker to work within Rails and why you'd want to