public_key_cryptography course - challenges 1 and 2 - pow and basic encryption

This commit is contained in:
boyreau 2026-11-05 12:08:15 +01:00
commit 410a1b7cac
2 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,8 @@
# Challenge PK-crypto-1
def modular_exponentiation():
return pow(101, 17, 22663)
# Challenge PK-crypto-2
def basic_encryption(message: int, p: int, q: int):
return pow(message, 0x10001, p * q)