neuroretransmit / liberprimus-tool

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

Permutations mode #8

Open neuroretransmit opened 6 months ago

neuroretransmit commented 6 months ago

A mode for identifying/fixing by permitting the plaintext to a list with possibilities for multi-character/bigram runes. These sections raise NotImplementedErrors in the source.

d4v1-sudo commented 6 months ago
def run(self, silent=False):
    """ Generic cradle to run decryptions """
    for num, text in zip(self.retrieval.nums, self.retrieval.retrieve()):
        if not silent:
            print_section_context(num, text)
        if not silent and self.show_runes:
            print(text)
            print("-----")
        if self.crypto.key:
            plaintexts = self.crypto.scheme(text,
                                            key=self.crypto.key,
                                            shift=self.crypto.shift,
                                            lookup=self.crypto.lookup,
                                            skips=self.crypto.skips,
                                            excludes=self.crypto.excludes)
            if not silent:
                for plaintext in plaintexts:
                    print(plaintext)
            else:
                self.plaintext.extend(plaintexts)
        else:
            plaintexts = self.crypto.scheme(text, lookup=self.crypto.lookup, shift=self.crypto.shift, skips=self.crypto.skips)
            if not silent:
                for plaintext in plaintexts:
                    print(plaintext)
            else:
                self.plaintext.extend(plaintexts)