Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/p/y/pyskein-1.0/test/test_skein.py   pyskein(Download)
    def testStreamCipher(self):
        c = skein.StreamCipher(key=b"secret", hasher=self.HASHER)
        x = c.encrypt(b"foobar")
        c = skein.StreamCipher(key=b"secret", hasher=self.HASHER)
        self.assertEqual(c.decrypt(x), b"foobar")
    def testStreamCipherBug(self):
        x = skein.StreamCipher(b'secret').encrypt(b'hello world')
        c = skein.StreamCipher(b'secret')
        self.assertRaises(TypeError, c.decrypt, 'string')
        self.assertEqual(c.decrypt(x), b'hello world')