Class: CryptoToolchain::Tools::EcbCutAndPasteAttack

Inherits:
Object
  • Object
show all
Includes:
DetermineBlocksize
Defined in:
lib/crypto_toolchain/tools/ecb_cut_and_paste_attack.rb

Instance Method Summary collapse

Methods included from DetermineBlocksize

#blocksize

Constructor Details

#initialize(replace: "user", with: "admin", oracle: CryptoToolchain::BlackBoxes::EcbCutAndPasteTarget.new, initial: "[email protected]") ⇒ EcbCutAndPasteAttack

Returns a new instance of EcbCutAndPasteAttack.



5
6
7
8
9
10
11
12
13
14
# File 'lib/crypto_toolchain/tools/ecb_cut_and_paste_attack.rb', line 5

def initialize(replace: "user",
               with: "admin",
               oracle: CryptoToolchain::BlackBoxes::EcbCutAndPasteTarget.new,
               initial: "[email protected]"
              )
  @oracle = oracle
  @replace = replace
  @replacement = with
  @initial = initial
end

Instance Method Details

#executeObject



16
17
18
# File 'lib/crypto_toolchain/tools/ecb_cut_and_paste_attack.rb', line 16

def execute
  without_text_to_change + replaced_text_only
end