with this script: [code] and this ciphertext.txt contents: [code] can you figure out the…
- User
with this script:
import requests import random from base64 import b64decode from secret import MESSAGE SOURCE = b64decode(b'aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2RhbmllbG1pZXNzbGVyL1NlY0xpc3RzL21hc3Rlci9QYXNzd29yZHMvQ29tbW9uLUNyZWRlbnRpYWxzLzEway1tb3N0LWNvbW1vbi50eHQ=').decode() class Vigenere: def __init__(self): r = requests.get(SOURCE) self.keys = r.text.split('\n') def keygen(self): while True: key = random.choice(self.keys) if key.isalpha(): break return key def encrypt(self, message, key): message = message.lower() ciphertext = '' for i, ch in enumerate(message): if ch.isalpha(): nch = ord(ch) - 97 nk = ord(key[i % len(key)]) - 97 ciphertext += chr((nch + nk) % 26 + 97) else: ciphertext += ch return ciphertext def main(): cipher = Vigenere() key = cipher.keygen() ciphertext = MESSAGE for _ in range(2): ciphertext = cipher.encrypt(ciphertext, key) with open('ciphertext.txt', 'w') as f: f.write(ciphertext) if __name__ == '__main__': main()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.