caellion-python-commons
caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key Class Reference

This class provides implementation of triple DES algorithm which uses MD5 hash of password as a key (it uses 16-byte key so it is triple DES with 2 keys) More...

Public Member Functions

def __init__ (self, password)
 Sets up the class for use. More...
 
def encrypt (self, data)
 Encrypts data with 3DES ECB algorithm. More...
 
def decrypt (self, cipher)
 Decodes and decrypts Base64-encoded 3DES-encrypted data. More...
 

Public Attributes

 password
 
 encryptionKey
 

Static Public Attributes

string password = ""
 
string encryptionKey = ""
 
 DES3 = None
 
 padmode = pyDes.PAD_PKCS5
 

Detailed Description

This class provides implementation of triple DES algorithm which uses MD5 hash of password as a key (it uses 16-byte key so it is triple DES with 2 keys)

Definition at line 10 of file tripledes.py.

Constructor & Destructor Documentation

◆ __init__()

def caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.__init__ (   self,
  password 
)

Sets up the class for use.

Parameters
passwordpassword to use for key generation

Definition at line 20 of file tripledes.py.

Member Function Documentation

◆ decrypt()

def caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.decrypt (   self,
  cipher 
)

Decodes and decrypts Base64-encoded 3DES-encrypted data.

Parameters
cipherbase64-encoded encrypted data to decrypt
Returns
decrypted string

Definition at line 45 of file tripledes.py.

◆ encrypt()

def caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.encrypt (   self,
  data 
)

Encrypts data with 3DES ECB algorithm.

Parameters
datadata to be encrypted
Returns
base64-encoded 3DES encrypted string

Definition at line 34 of file tripledes.py.

Member Data Documentation

◆ DES3

caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.DES3 = None
static

Definition at line 17 of file tripledes.py.

◆ encryptionKey [1/2]

string caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.encryptionKey = ""
static

Definition at line 16 of file tripledes.py.

◆ encryptionKey [2/2]

caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.encryptionKey

Definition at line 30 of file tripledes.py.

◆ padmode

caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.padmode = pyDes.PAD_PKCS5
static

Definition at line 18 of file tripledes.py.

◆ password [1/2]

string caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.password = ""
static

Definition at line 15 of file tripledes.py.

◆ password [2/2]

caellion.pycommons.encryption.tripledes.TripleDESECBMD5Key.password

Definition at line 26 of file tripledes.py.


The documentation for this class was generated from the following file: