Created
December 14, 2009 12:43
-
-
Save jmeridth/256021 to your computer and use it in GitHub Desktop.
ruby rijndael encryption - add IV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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