[PYTHON-CRYPTO] amkCrypto: Cipher decrypt(string) output

Jason R. Mastaler jason-list-python-crypto at MASTALER.COM
Tue Mar 27 23:29:05 CEST 2001


I'm experimenting with amkCrypto, and I'm confused about the output
I'm getting back from a decrypted string.

        #!/usr/bin/env python
        import time
        from Crypto.Cipher import Blowfish
        key = '146bfea4ab7274e6f0ccff25351c2f39'
        cipherobj=Blowfish.new(key, Blowfish.CBC)
        input =  '%16d' % (time.time() +1)
        dated_cookie = cipherobj.encrypt(input)
        plaintext = cipherobj.decrypt(dated_cookie)

        print input
        print plaintext

This code produces the following output:
       985728133
ß
-------------- next part --------------
’X~?
-------------- next part --------------
¥{85728133

Why aren't input and plaintext identical?  The strings end the same,
but plaintext seems to have some binary characters at its beginning.


More information about the python-crypto mailing list