Пример #1
0
def test_encrypt_privkey(key, plain, cipher):
    encrypter = IntegerEncrypter(PrivateKey(key['p'], key['q'], key['e']))
    assert encrypter.encrypt(plain) == cipher
Пример #2
0
def test_decrypt(key, plain, cipher):
    encrypter = IntegerEncrypter(PrivateKey(key['p'], key['q'], key['e']))
    assert encrypter.decrypt(cipher) == plain
Пример #3
0
def test_encrypt_pubkey(key, plain, cipher):
    encrypter = IntegerEncrypter(PublicKey(key['n'], key['e']))
    assert encrypter.encrypt(plain) == cipher