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

Ruby Rails

Removing fields with a Rails migration

Ruby on Rails gives you powerful tools to make removing old fields easy, lets walk through how we can do this


Calculating Instagram Velocity From Your Browser

A small script that lets you quickly work out the velocity for posts within a hashtag