Add a Crypto.bruteforce method which takes a wordlist and passes each password to the given block, which then tries to decrypt the String. The method should then test whether the decrypted String has entropy below 7.0 or contains a plaintext String.
Crypto.bruteforce(cipher_text, wordlist: 'AAAA'..'ZZZZ') do |password|
cipher_text.aes256_decrypt(password: password)
end
Crypto.bruteforce(cipher_text, wordlist: Chars.ascii, matches: /^CNS/) do |key|
cipher_text.xor(key)
end
Add a
Crypto.bruteforce
method which takes a wordlist and passes each password to the given block, which then tries to decrypt the String. The method should then test whether the decrypted String has entropy below 7.0 or contains a plaintext String.