Post

Pycimal - TryCrack.Me Python Code Review Challange Walkthrough

Are you ready for a Code Review Challenge ??

Let’s dive into a Python code review challenge from TryCrack.ME and elevate our skills stats.

  • The purpose of this review is to go through the Python code provided for the Pycimal challenge from TryCrack.Me and to solve the challenge effectively. We will break down the code, understand its functionality, and then proceed with solving the problem.

——-Difficulty : EASY——-

Here is our code…..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
your_input = ""
password = ""
intPass = "83,117,112,101,114,83,101,99,117,114,\
101,80,97,115,115,119,111,114,100,87,104,105,99,\
104,67,97,110,116,66,101,67,114,97,99,107,101,100,\
87,105,116,104,111,117,116,66,108,97,99,107,109,97,\
103,105,99"
 
intPass = intPass.split(",")
 
for c in intPass:
    password = password + chr(int(c))
    
if your_input == password:
    print("Good job!")
    
else:
    print("Wrong password")

# What does this code says ???…

If you know a bit about programming, you’ll notice that the password is just numbers. The chr() function turns those numbers into their matching ASCII characters.

The intPass string contains comma-separated numbers, which are converted to their corresponding ASCII characters using the chr() function. Decoding these numbers give us the password value.

Here’s how the password is derived:

# Step-by-Step Decoding :

  1. Split intPass by commas.
  2. Convert each number to its corresponding ASCII character using chr().
  3. Concatenate the characters to form the password.

# The Numbers inintPass variable ,

1
83, 117, 112, 101, 114, 83, 101, 99, 117, 114, 101, 80, 97, 115, 115, 119, 111, 114, 100, 87, 104, 105, 99, 104, 67, 97, 110, 116, 66, 101, 67, 114, 97, 99, 107, 101, 100, 87, 105, 116, 104, 111, 117, 116, 66, 108, 97, 99, 107, 109, 97, 103, 105, 99

# Decoding Characters

1
SuperSecurePasswordWhichCantBeCrackedWithout<redacted>

image

If your_input matches this string, the code will print “Good job!”

# Build an Automated Python Script to Solve Our Challenge

  • Let’s Create a python script that solves our challenge automatically ….Automating little things in your daily life can teach you many concepts ….
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
intPass = "83,117,112,101,114,83,101,99,117,114,\ 101,80,97,115,115,119,111,114,100,87,104,105,99,\ 104,67,97,110,116,66,101,67,114,97,99,107,101,100,\ 87,105,116,104,111,117,116,66,108,97,99,107,109,97,\ 103,105,99"

# Split intPass into individual ASCII Codes 

intPass = intPass.split(",")

# Generate the password by converting ASCII codes to chracters 
password = ""
for c in intPass:
	password += chr(int(c))

# Display the Password 
print(f"Generated password : {password}")

# Example input for comparision
your_input = input("Enter you input to compare:")

if you_input == password:
	print("Good job!")
else:
	print("Wrong Password")

[Pasted image 20241001103039.png]

CODE REVIEW STATS = 1



# Final Thoughts


I hope this space continues to be helpful in your learning journey!. If you find this blog helpful, I’d love to hear your thoughts—my inbox is always open for feedback. Please excuse any typos, and feel free to point them out so I can correct them. Thanks for understanding and happy learning!. You can contact me on Linkedin and Twitter

This post is licensed under CC BY 4.0 by the author.