Ejemplo n.º 1
0
    def test_decrypt_failure(self):
        data = b"data"
        passphrase = "A secret"
        cyphertext = encrypt(data, passphrase, count=10)

        with pytest.raises(ValueError):
            plaintext = decrypt(cyphertext, "Fake key")
Ejemplo n.º 2
0
    def test_encrypt(self, data):
        passphrase = "A secret"
        cyphertext = encrypt(data, passphrase, count=10)
        plaintext = decrypt(cyphertext, passphrase)

        assert data == plaintext