Class: CryptoToolchain::Tools::RSAUnpaddedMessageRecoveryAttack
- Defined in:
- lib/crypto_toolchain/tools/rsa_unpadded_message_recovery_attack.rb
Instance Attribute Summary collapse
-
#oracle ⇒ Object
readonly
Returns the value of attribute oracle.
-
#s ⇒ Object
readonly
Returns the value of attribute s.
Instance Method Summary collapse
- #execute(ciphertext) ⇒ Object
-
#initialize(oracle:, s: 2) ⇒ RSAUnpaddedMessageRecoveryAttack
constructor
A new instance of RSAUnpaddedMessageRecoveryAttack.
Constructor Details
#initialize(oracle:, s: 2) ⇒ RSAUnpaddedMessageRecoveryAttack
Returns a new instance of RSAUnpaddedMessageRecoveryAttack.
7 8 9 10 |
# File 'lib/crypto_toolchain/tools/rsa_unpadded_message_recovery_attack.rb', line 7 def initialize(oracle: , s: 2) @oracle = oracle @s = s end |
Instance Attribute Details
#oracle ⇒ Object (readonly)
Returns the value of attribute oracle.
5 6 7 |
# File 'lib/crypto_toolchain/tools/rsa_unpadded_message_recovery_attack.rb', line 5 def oracle @oracle end |
#s ⇒ Object (readonly)
Returns the value of attribute s.
5 6 7 |
# File 'lib/crypto_toolchain/tools/rsa_unpadded_message_recovery_attack.rb', line 5 def s @s end |
Instance Method Details
#execute(ciphertext) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/crypto_toolchain/tools/rsa_unpadded_message_recovery_attack.rb', line 12 def execute(ciphertext) plaintext( p_prime( c_prime( ciphertext.to_number ) ) ) end |