question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[πŸ›] Challenge Blockchain Hype - Wrong RSA-Module in pyc

See original GitHub issue

πŸ› Bug report

Description

The file announcement_encrypted.md, which is part of the challenge β€œBlockchain Hype” is not decryptable as the file /ftp/encrypt.pyc contains the wrong value for N. This is likely due to a mismatch between the sourcefile test/files/encrypt.py and the compiled file ftp/encrypt.pyc

Is this a regression?

No, the file hasn’t been modified since being added as part of bffa158b5c961d6e19b127150e91ec64924db73c

πŸ”¬ Minimal Reproduction

Download the file encrypt.pyc using null-byte-injection. Run it through a python decompiler. Uncompyle6 returned:

# uncompyle6 version 3.7.0
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.17 (default, Apr 15 2020, 17:20:14) 
# [GCC 7.5.0]
# Embedded file name: encrypt.py
# Compiled at: 2020-05-20 18:58:36
confidential_document = open('announcement.md', 'r')
N = 36239973541558932215768154398027510542999295460598793991863043974317503405132258743580804101986195705838099875086956063357178601077684772324064096356684008573295186622116931603804539480260180369510754948354952843990891989516977978839158915835381010468654190434058825525303974958222956513586121683284362090515808508044283236502801777575604829177236616682941566165356433922623572630453807517714014758581695760621278985339321003215237271785789328502527807304614754314937458797885837846005142762002103727753034387997014140695908371141458803486809615038309524628617159265412467046813293232560959236865127539835290549091L
e = 65537
encrypted_document = open('announcement_encrypted.md', 'w')
for char in confidential_document.read():
    encrypted_document.write(str(pow(ord(char), e, N)) + '\n')

encrypted_document.close()
# okay decompiling encrypt.py

It is not possible to decrypt the content of announcement_encrypted.md using this value N. Encryption works fine using the value for N from test/files/encrypt.py. The decrypt.py and decrypt._bruteforce.py contain the correct N as well. If I compile encrypt.py diff shows that the newly generated encrypt.pyc differs from ftp/encrypted.pyc. If I decompile the newly compiled encrypt.pyc again using uncompyle6 I get the correct value for N.

πŸ”₯ Exception or Error




N/A

🌳 Your Environment




Docker Image: bkimminich/juice-shop:latest

Additional Information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jainendracommented, May 21, 2020

@bkimminich Yes, this is indeed the wrong encrypted file, not sure how this went through. Thanks @timmar2000 for pointing out and fixing it. πŸ‘

0reactions
github-actions[bot]commented, Aug 11, 2021

This thread has been automatically locked because it has not had recent activity after it was closed. πŸ”’ Please open a new issue for regressions or related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrong RSA-Module in pyc Β· Issue #1392 Β· juice-shop ...
Bug report Description The file announcement_encrypted.md, which is part of the challenge "Blockchain Hype" is not decryptable as the fileΒ ...
Read more >
Growing scepticism challenges the blockchain hype
Growing scepticism challenges the blockchain hype. Companies recognise that the technology has yet to be adapted for the real world.
Read more >
Helping blockchain communities fix bugs | MIT News
But Web 3 still has some significant challenges to overcome if it's ... in blockchain hype and the corresponding crash of crypto prices....
Read more >
There's No Good Reason to Trust Blockchain Technology
Opinion: Cryptocurrencies are useless. Blockchain solutions are frequently much worse than the systems they replace. Here's why.
Read more >
Blockchain and Economic Development: Hype vs. Reality
We argue that, while blockchain-based solutions have the potential to increase efficiency and improve outcomes dramatically in some use cases and moreΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found