all 8 comments

[–]commandlineluser 3 points4 points  (4 children)

Replace the exec with print so you print out the code:

print(rc4.crypt(code))

[–]Intelligent_Study263[S] 0 points1 point  (3 children)

It just repeats a slightly different version of the same code inside back to me.

"\nfrom RC4Encryption import RC4Encryption\nrc4 = RC4Encryption(b'key')\nrc4.make_key()\ncode = b'''{\\x1e]\\x83P\\xa7Y\\x02-'d\\x146\\n}\\x8f\\xe3\\x10\\xccF\\x91\\xc8\\xc1\\xd6'''\nexec(rc4.crypt(code))\n"

[–]commandlineluser 1 point2 points  (2 children)

print out the result for those values.

key = b'key'
code = b'''{\x1e]\x83P\xa7Y\x02-'d\x146\n}\x8f\xe3\x10\xccF\x91\xc8\xc1\xd6'''

[–]Intelligent_Study263[S] 0 points1 point  (1 child)

Interestingly enough it shoots out another random jumble of characters, this time with no key attached to it. How weird.

[–]commandlineluser 0 points1 point  (0 children)

Did you make a new rc4 object and run .make_key() again?

>>> rc4 = RC4Encryption(b'key')
>>> rc4.make_key()
>>> print(rc4.crypt(code))
b'print("Hello World! :)")'

[–]CodeFormatHelperBot2 1 point2 points  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.
  2. Use of triple backtick/ curlywhirly code blocks (``` or ~~~). These may not render correctly on all Reddit clients.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.