#๐ so i am trying to solve this code and i am stuck please help
72 messages ยท Page 1 of 1 (latest)
@waxen harness
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
This is the program we believe was used to encode the intercepted message.
some of the retrieved program was damaged (show as &&&&)
Can you use this to figure out how it was encoded and decode it?
Good Luck
import string
import random
from base64 import b64encode, b64decode
secret = '&&&&&&&&&&&&&&' # We don't know the original message or length
secret_encoding = ['step1', 'step2', 'step3']
def step1(s):
_step1 = string.maketrans("zyxwvutsrqponZYXWVUTSRQPONmlkjihgfedcbaMLKJIHGFEDCBA","mlkjihgfedcbaMLKJIHGFEDCBAzyxwvutsrqpo")
return string.translate(s, _step1)
def step2(s): return b64encode(s)
def step3(plaintext, shift=4):
loweralpha = string.ascii_lowercase
shifted_string = loweralpha[shift:] + loweralpha[:shift]
converted = string.maketrans(loweralpha, shifted_string)
return plaintext.translate(converted)
def make_secret(plain, count):
a = '2{}'.format(b64encode(plain))
for count in range(count):
r = random.choice(secret_encoding)
si = secret_encoding.index(r) + 1
_a = globals()r
a = '{}{}'.format(si, _a)
return a
if name == 'main':
print make_secret(secret, count=&&&)
this is the code
!code
yeah i did that but im still getting errors i changed some code soo far
describe your error.
so I suppose the code in this snip is something that makes a secret
and now, you have to work backwards, right?
yes but im getting a bit confused on what to change it in too
so like going backwards
yes
if there's a function that makes A -> B, make something that takes the B and makes it A. B -> A
and also is it better to do it on pycharm then put it in kali linux after
ohhh okay so its better for me to stay in kali linux and do it
its fine focus on the logic ๐ญ
yeah sorry im a lil bit slow just tryna decode this message ๐ข
so i need to reverse the logic
ohh okay so i cant reverse random.choise but i can reverse the other stuff
it will be a blocker
ohh so what does this mean i wont be able to reverse it now do i got ot remove reverse.random
do you have the encoded string with you
yes i do i will share
is it a part of the question
yes it is
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
use the above link
just post the code
i feel im missing something
just wanna cross check if the random is seeded
not the string ๐ข i meant the code
random is not seeded
you can run a small example program:
import random
a = [1, 2, 3]
print(random.choice(a))
to get a different number on each run
yeah i ran a small program
what does this mean
does
this mena i cna
reverse it
no you can't
damn so what do i do now to be able to use this as a decoded
hello is there anything i can try do to use this as a decoder
post the channel name in #python-discussion
so i am trying to solve this code to try and decode the message and i am stuck please help
i posted in discussion and i didnt get a reply
didnt he not give it to us in thi s
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.