# File lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb, line 10 10: def sage_decrypt(ciphertext, key) 11: sage_encrypt_xor(ActiveSupport::Base64.decode64(ciphertext), key) 12: end
# File lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb, line 21 21: def sage_encrypt_xor(data, key) 22: raise 'No key provided' if key.blank? 23: 24: key *= (data.length.to_f / key.length.to_f).ceil 25: key = key[0, data.length] 26: 27: data.bytes.zip(key.bytes).map { |b1, b2| (b1 ^ b2).chr }.join 28: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.