klefki.crypto.rsa

ref: https://www.wikiwand.com/zh-hans/%E8%BC%BE%E8%BD%89%E7%9B%B8%E9%99%A4%E6%B3%95

Module Contents

Functions

mod_inverse(a, m)

gcd = as + mt

klefki.crypto.rsa.mod_inverse(a, m)

gcd = as + mt ab = 1 (mod m) a and m are relatively prime

class klefki.crypto.rsa.RSA(p, q)

ref: https://www.wikiwand.com/en/RSA_(cryptosystem) You should always use encrypt and decrypt never use encrypt/decrypt with xxx-key without knowing what you are doing.

e = 65537
encrypt_block
decrypt_block
property public_key(self)
property private_key(self)
decrypt_with_pub_key(self, block: int)
encrypt_with_private_key(self, block: int) → int
encrypt_with_pub_key(self, block: int)
decrypt_with_private_key(self, block: int) → int
static decrypt(msg, e, n)
encrypt_string(self, message: str) → list
decrypt_string(self, encrypted: list)
static parse_lv_pubkey(pub)
classmethod verify_ssh_rsa_sig(cls, sig, msg, pub, alog='SHA256')