2026-11-05 12:08:15 +01:00
|
|
|
# Challenge PK-crypto-1
|
2026-11-05 12:09:50 +01:00
|
|
|
def modular_exponentiation() -> int:
|
2026-11-05 12:08:15 +01:00
|
|
|
return pow(101, 17, 22663)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Challenge PK-crypto-2
|
2026-11-05 12:09:50 +01:00
|
|
|
def basic_encryption(message: int, p: int, q: int) -> int:
|
2026-11-05 12:08:15 +01:00
|
|
|
return pow(message, 0x10001, p * q)
|
2026-11-05 12:09:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# Challenge PK-crypto-3
|
|
|
|
|
def Euler_totient(p: int, q: int) -> int:
|
|
|
|
|
return (p - 1) * (q - 1)
|