optimisticninja / liberprimus-tool

Python tool/libraray for evolving solutions toward the Liber Primus from Cicada 3301
1 stars 1 forks source link

Consolidate works/solves/decrypts to build wordlist with wordlister #11

Open optimisticninja opened 2 months ago

optimisticninja commented 2 months ago

Reference #5

To intelligently select keys for keyed algorithms - use wordlister to create a list of words/phrases from things encountered throughout the puzzle.

wordlister

d4v1-sudo commented 2 months ago

A simple example for an start of implementing https://github.com/4n4nk3/Wordlister/blob/master/wordlister.py more forward

def consolidate_words(texts):
    wordlist = set()
    for text in texts:
        words_and_phrases = text.split()
        for word_or_phrase in words_and_phrases:
            wordlist.add(word_or_phrase.strip().lower())
    return sorted(wordlist)

texts = ["Hello world", "Lorem ipsum dolor sit amet"]
consolidated_wordlist = consolidate_words(texts)
print(consolidated_wordlist)

with open("wordlist.txt", "w") as f:
    for word in consolidated_wordlist:
        f.write(word + "\n")