lib/active_url/crypto.rb in mholling-active_url-0.1.2 vs lib/active_url/crypto.rb in mholling-active_url-0.1.3
- old
+ new
@@ -2,9 +2,11 @@
require 'digest/sha2'
require 'base64'
module ActiveUrl
module Crypto
+ CipherError = OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError
+
PADDING = { 2 => "==", 3 => "=" }
def self.encrypt(clear)
crypto = start(:encrypt)
cipher = crypto.update(clear)
\ No newline at end of file