PwnSecCTF 24 Writeups
In this page, I'll be sharing the writeups to the challenges i wrote for PwnSecCTF 24
RSNAY - Cryptography (EASY)
from Crypto.Util.number import *
from secret import flag,e,n
def encrypt(m):
return pow(m,e,n)
assert (pow(encrypt(flag),e,n) - flag) % GCD(e,n) == 0
menu = """Welcome to my Encryption Service!
Choose an option:
1. Encrypt
2. Get Flag
3. Exit
"""
def main():
encryption_counter = 0
print(menu)
while True:
choice = input("Enter your choice: ")
if choice == '1':
if encryption_counter >= 2:
print("You have reached the maximum number of encryptions allowed!")
break
else:
encryption_counter += 1
m = int(input("Enter the message you want to encrypt: "))
print(f"Here is your encrypted message: {encrypt(m)}")
elif choice == '2':
print(f"Here is your flag: {encrypt(flag)}")
elif choice == '3':
print("Goodbye!")
break
else:
print("Invalid choice! Please try again.")
continue
if __name__ == "__main__":
main()Understanding and Breaking the Assertion
Finding (N)
Finding (p)
Solver
Calculus Help - Cryptography (EASY)
What is Simpson’s Rule?
Steps to Solve the Challenge
Why Simpson’s Rule?
Summary of Key Steps:
Solver
Unintended Solve

Personal Reflection
Last updated
