Package Crypto :: Package Cipher :: Module XOR :: Class XORCipher
[frames] | no frames]

Class XORCipher

XOR cipher object
Instance Methods
 
__init__(self, key, *args, **kwargs)
Initialize a XOR cipher object
 
encrypt(self, plaintext)
Encrypt a piece of data.
 
decrypt(self, ciphertext)
Decrypt a piece of data.
Method Details

__init__(self, key, *args, **kwargs)
(Constructor)

 

Initialize a XOR cipher object

See also new() at the module level.

encrypt(self, plaintext)

 
Encrypt a piece of data.
Parameters:
  • plaintext (byte string) - The piece of data to encrypt. It can be of any size.
Returns:
the encrypted data (byte string, as long as the plaintext).

decrypt(self, ciphertext)

 
Decrypt a piece of data.
Parameters:
  • ciphertext (byte string) - The piece of data to decrypt. It can be of any size.
Returns:
the decrypted data (byte string, as long as the ciphertext).