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