public_key_cryptography course - challenges 4 - private key computation
This commit is contained in:
parent
c72e3335ea
commit
ac83990bc9
2 changed files with 7 additions and 0 deletions
|
|
@ -11,3 +11,8 @@ def basic_encryption(message: int, p: int, q: int) -> int:
|
|||
# Challenge PK-crypto-3
|
||||
def Euler_totient(p: int, q: int) -> int:
|
||||
return (p - 1) * (q - 1)
|
||||
|
||||
|
||||
# Challenge PK-crypto-4
|
||||
def private_key(p: int, q: int, exp: int) -> int:
|
||||
return pow(exp, -1, (p - 1) * (q - 1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue