def test_encrypt_privkey(key, plain, cipher): encrypter = IntegerEncrypter(PrivateKey(key['p'], key['q'], key['e'])) assert encrypter.encrypt(plain) == cipher
def test_decrypt(key, plain, cipher): encrypter = IntegerEncrypter(PrivateKey(key['p'], key['q'], key['e'])) assert encrypter.decrypt(cipher) == plain
def test_encrypt_pubkey(key, plain, cipher): encrypter = IntegerEncrypter(PublicKey(key['n'], key['e'])) assert encrypter.encrypt(plain) == cipher