Class: Interactsh::Crypto

Inherits:
Object
  • Object
show all
Defined in:
lib/interactsh/crypto.rb

Overview

Cryptographic operations for Interactsh

Instance Method Summary collapse

Constructor Details

#initialize(rsa) ⇒ Crypto

Returns a new instance of Crypto.



6
7
8
# File 'lib/interactsh/crypto.rb', line 6

def initialize(rsa)
  @rsa = rsa
end

Instance Method Details

#decrypt_data(aes_key, enc_data) ⇒ Hash

Decrypts interaction data using the provided AES key

Parameters:

  • aes_key (String)

    The encrypted AES key

  • enc_data (String)

    The encrypted data

Returns:

  • (Hash)

    The decrypted interaction data



15
16
17
18
19
20
# File 'lib/interactsh/crypto.rb', line 15

def decrypt_data(aes_key, enc_data)
  decrypted_aes_key = decrypt_aes_key(aes_key)
  decrypt_payload(decrypted_aes_key, enc_data)
rescue StandardError => e
  raise DecryptionError, "Error decrypting data: #{e.message}"
end