Skip to content

Instantly share code, notes, and snippets.

@jmeridth
Created December 14, 2009 12:43
Show Gist options
  • Save jmeridth/256021 to your computer and use it in GitHub Desktop.
Save jmeridth/256021 to your computer and use it in GitHub Desktop.
ruby rijndael encryption - add IV
module Crypt
class Rijndael
def vector() @vector; end
alias orig_initialize initialize
def initialize(key, vector, keyBits = 256, blockBits = 128)
@vector = vector
orig_initialize(key, keyBits, blockBits)
end
alias orig_generate_initialization_vector generate_initialization_vector
def generate_initialization_vector( *p )
@vector || orig_generate_initialization_vector( *p )
end
def iv_length() block_size; end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment