Wegpunkt-Suche: 
 
Rätselcache

Richtig Sichere Angelegenheit

Bob needs your help! Please help him decrypt the secret message!

von BafTux     Österreich > Wien > Wien

N 48° 15.689' E 016° 23.811' (WGS84)

 andere Koordinatensysteme
 Größe: mikro
Status: kann gesucht werden
 Versteckt am: 15.06.2022
 Veröffentlicht am: 07.04.2026
 Letzte Änderung: 07.04.2026
 Listing: https://opencaching.de/OC18C6F
Auch gelistet auf: geocaching.com 

1 gefunden
0 nicht gefunden
0 Bemerkungen
1 Beobachter
0 Ignorierer
19 Aufrufe
0 Logbilder
Geokrety-Verlauf

große Karte

   

Saisonbedingt
Benötigt Vorarbeit

Beschreibung    Deutsch  ·  English

Changelog

2022-06-15 - Initial release (gc only)
2026-04-07 - Publish on oc; No content changes.

Description

Bob needs your help! He and Alice are communicating via encrypted texts and Bob just received a new message from Alice:

WUaPSMWHPjsZ/t0MPYksZsfxH2en56TDyu+9CUirg/l4c5yqQxeUG8hmIYYsB7nU6XUaM1yzMp3gVco9w+olvw==

Unfortunately, Bob has forgotten the private key to decrypt the message. However, he still has the self-implemented source code of the decryption tool. Can you help Bob to recover the original message from Alice?

import base64

def main():
    print('Richtig Sicherer Austausch (v1.0 - 2022-06-05)')
 
    cipher = read_cipher("WUaPSMWHPjsZ/t0MPYksZsfxH2en56TDyu+9CUirg/l4c5yqQxeUG8hmIYYsB7nU6XUaM1yzMp3gVco9w+olvw==")
    # This line asks for the key on the command line
    # key = read_key()
    # You can also directly pass in the key:
    key = read_key(17)
 
    decrypt(cipher, key)
 
def decrypt(cipher, key):
    cipher_num = int.from_bytes(cipher, byteorder='big')
 
    # Remember, e = 0x10001, Hopefully no one knows the prime factors of this number
    modulus = 10941738641570527421809707322040357612003732945449205990913842131476349984288934784717997257891267332497625752899781833797076537244027146743531593354333897
    plain_num = pow(cipher_num, key, modulus)
 
    plain_bytes = plain_num.to_bytes( (plain_num.bit_length() + 7) // 8, byteorder='big')
    try:
        plain_text = plain_bytes.decode('utf8')
        print(f'plaintext = {plain_text}')
    except UnicodeDecodeError:
        print('Failed to decrypt message. Wrong key!?')
 
def read_cipher(cipher=None):
    """
    Reads the base64 encoded cipher and converts it into a byte array
    """
    if cipher is None:
        cipher = input('Enter the ciphertext: ')
 
    decoded = base64.b64decode(cipher)
    return [bb for bb in decoded]
 
def read_key(key=None):
    if key is None:
        key = input('Enter the key (in base 10): ')
 
    return int(key)
 
if __name__ == '__main__':
    main()

Further information

Brute-Force is not necessary. The result should be unambiguous. You dont have to modify the given decryption code, you only have to provide the correct key.

Acknowledgements

Thanks to the beta testers for testing & their feedback.

  • AimyBits
  • Dementophobia

Verschlüsselter Hinweis   Entschlüsseln

[puzzle] Eba, Nqv, naq Yrbaneq pna uryc lbh. Urezna naq uvf grnz cebonoyl nf jryy.
[cache] Frr zrffntr sebz Nyvpr

A|B|C|D|E|F|G|H|I|J|K|L|M
N|O|P|Q|R|S|T|U|V|W|X|Y|Z

Hilfreiches

Suche Caches im Umkreis: alle - suchbare - gleiche Cacheart
Download als Datei: GPX - LOC - KML - OV2 - OVL - TXT - QR-Code
Mit dem Herunterladen dieser Datei akzeptierst du unsere Nutzungsbedingungen und Datenlizenz.

Logeinträge für Richtig Sichere Angelegenheit    gefunden 1x nicht gefunden 0x Hinweis 0x

gefunden 08.08.2022, 06:46 Tankred der Zweite hat den Geocache gefunden

Tja, was soll ich sagen?
Das ist ganz sicher nicht mein Spezialgebiet 😔
Aber man muss ja nicht alles wissen, sondern nur wissen, wo man nachschauen/-fragen kann 😁
Und selbst dann ist es fast unmöglich zu verstehen 🤪
Aber der Fund ging rasch und ungestört über die Bühne 👍🏻
Danke für dieses knackige Rätsel!
TFTC