Skip to content

Instantly share code, notes, and snippets.

class Slug
CIPHER = 'RC2'.freeze
def initialize(key, iv)
@key = key
@iv = self.class.hex_to_bytes(iv)
end
def self.generate_iv
bytes_to_hex(OpenSSL::Cipher.new(CIPHER).random_iv)