Class: CryptoToolchain::BlackBoxes::RSAPaddingOracle
- Defined in:
- lib/crypto_toolchain/black_boxes/rsa_padding_oracle.rb
Instance Attribute Summary collapse
-
#keypair ⇒ Object
readonly
Returns the value of attribute keypair.
Instance Method Summary collapse
- #execute(str) ⇒ Object
-
#initialize(keypair: CryptoToolchain::BlackBoxes::RSAKeypair.new(bits: 256)) ⇒ RSAPaddingOracle
constructor
A new instance of RSAPaddingOracle.
Constructor Details
#initialize(keypair: CryptoToolchain::BlackBoxes::RSAKeypair.new(bits: 256)) ⇒ RSAPaddingOracle
Returns a new instance of RSAPaddingOracle.
4 5 6 |
# File 'lib/crypto_toolchain/black_boxes/rsa_padding_oracle.rb', line 4 def initialize(keypair: CryptoToolchain::BlackBoxes::RSAKeypair.new(bits: 256)) @keypair = keypair end |
Instance Attribute Details
#keypair ⇒ Object (readonly)
Returns the value of attribute keypair.
8 9 10 |
# File 'lib/crypto_toolchain/black_boxes/rsa_padding_oracle.rb', line 8 def keypair @keypair end |
Instance Method Details
#execute(str) ⇒ Object
10 11 12 13 14 |
# File 'lib/crypto_toolchain/black_boxes/rsa_padding_oracle.rb', line 10 def execute(str) keypair. decrypt(str, pad: true). is_pkcs1_5_padded?(keypair.bits) end |