Exemplo n.º 1
0
	def testDecidBad(self):
		# try decoding a non integer ciphertext
		c = Crypto('some secret key_')
		plaintext = 'foo'
		ciphertext = c.enc(plaintext)
		with throwing(CryptoException):
			plaintext2 = c.decid(ciphertext)
Exemplo n.º 2
0
	def testEncidDecid(self):
		c = Crypto('some secret key_')
		plaintext = 1
		ciphertext = c.encid(plaintext)
		plaintext2 = c.decid(ciphertext)
		assert plaintext == plaintext2