Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Crypto.bruteforce method #495

Open
postmodern opened this issue Mar 24, 2024 · 0 comments
Open

Add a Crypto.bruteforce method #495

postmodern opened this issue Mar 24, 2024 · 0 comments
Labels
crypto Cryptography feature New Feature idea Random idea

Comments

@postmodern
Copy link
Member

postmodern commented Mar 24, 2024

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

The method should return multiple matches, and return both the password and the decrypted value:

[
  ["password123", "hello world"],
  ...,
  ["xjklfdjsklf", ".....hello....."]
]
@postmodern postmodern added feature New Feature crypto Cryptography labels Mar 24, 2024
@postmodern postmodern added the idea Random idea label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Cryptography feature New Feature idea Random idea
Projects
None yet
Development

No branches or pull requests

1 participant