Crypto.Cipher.ARC4, bust or me doing something wrong?
michaels at rd.bbc.co.uk
Wed Sep 21 09:23:58 CEST 2005
Michael J. Fromberger wrote:
> Since ARC4 is a stream cipher, the keystream changes over time -- with
> ARC4, after each character enciphered. To decrypt successfully, you
> need to make sure the decrypting keystream exactly matches the
> encrypting one.
>>>> from Crypto.Cipher import ARC4 as cipher
>>>> enc = cipher.new("abcdefgh")
>>>> dec = cipher.new("abcdefgh")
>>>> x = enc.encrypt("This is some random text")
>>>> y = dec.decrypt(x)
> 'This is some random text'
> I hope this helps clear up your confusion.
Thanks for this, much appreciated.
Michael.Sparks at rd.bbc.co.uk, http://kamaelia.sourceforge.net/
British Broadcasting Corporation, Research and Development
Kingswood Warren, Surrey KT20 6NP
This message (and any attachments) may contain personal views
which are not the views of the BBC unless specifically stated.
More information about the Python-list