My Project
Loading...
Searching...
No Matches
wolfcrypt.ciphers._Cipher Class Reference
Inheritance diagram for wolfcrypt.ciphers._Cipher:
wolfcrypt.ciphers.Aes

Public Member Functions

 __init__ (self, key, mode, IV=None)
 
 new (cls, key, mode, IV=None, **kwargs)
 
 encrypt (self, string)
 
 decrypt (self, string)
 

Data Fields

 key_size
 
 block_size = self.block_size:
 

Protected Attributes

 _key_sizes
 
 _native_object = _ffi.new(self._native_type)
 
 _enc = None
 
 _dec = None
 
 _key = t2b(key)
 
 _IV = t2b(IV)
 

Detailed Description

A **PEP 272: Block Encryption Algorithms** compliant
**Symmetric Key Cipher**.

Member Function Documentation

◆ decrypt()

wolfcrypt.ciphers._Cipher.decrypt ( self,
string )
Decrypts **string**, using the key-dependent data in the
object and with the appropriate feedback mode. The string's
length must be an exact multiple of the algorithm's block
size or, in CFB mode, of the segment size.  Returns a string
containing the plaintext.

◆ encrypt()

wolfcrypt.ciphers._Cipher.encrypt ( self,
string )
Encrypts a non-empty string, using the key-dependent data in
the object, and with the appropriate feedback mode. The
string's length must be an exact multiple of the algorithm's
block size or, in CFB mode, of the segment size. Returns a
string containing the ciphertext.

◆ new()

wolfcrypt.ciphers._Cipher.new ( cls,
key,
mode,
IV = None,
** kwargs )
Returns a ciphering object, using the secret key contained in
the string **key**, and using the feedback mode **mode**, which
must be one of MODE_* defined in this module.

If **mode** is MODE_CBC or MODE_CFB, **IV** must be provided and
must be a string of the same length as the block size. Not
providing a value of **IV** will result in a ValueError exception
being raised.