Package tlslite :: Package utils :: Module rijndael
[show private | hide private]
[frames | no frames]

Module tlslite.utils.rijndael

A pure python (slow) implementation of rijndael with a decent interface

To include -

from rijndael import rijndael

To do a key setup -

r = rijndael(key, block_size = 16)

key must be a string of length 16, 24, or 32 blocksize must be 16, 24, or 32. Default is 16

To use -

ciphertext = r.encrypt(plaintext) plaintext = r.decrypt(ciphertext)

If any strings are of the wrong length a ValueError is thrown
Classes
rijndael  

Function Summary
  decrypt(key, block)
  encrypt(key, block)
  test()

Variable Summary
dict num_rounds = {16: {16: 10, 24: 12, 32: 14}, 24: {16: 12,...
list rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 1...
list S = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, ...
list shifts = [[[0, 0], [1, 3], [2, 2], [3, 1]], [[0, 0], [1,...
list Si = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 15...
list T1 = [-966564955, -126059388, -294160487, -159679603, -8...
list T2 = [-1513725085, -2064089988, -1712425097, -1913226373...
list T3 = [1671808611, 2089089148, 2006576759, 2072901243, -2...
list T4 = [1667474886, 2088535288, 2004326894, 2071694838, -2...
list T5 = [1374988112, 2118214995, 437757123, 975658646, 1001...
list T6 = [1347548327, 1400783205, -1021700188, -1774573730, ...
list T7 = [-1487908364, 1699970625, -1530717673, 1586903591, ...
list T8 = [-190361519, 1097159550, 396673818, 660510266, -141...
list U1 = [0, 235474187, 470948374, 303765277, 941896748, 908...
list U2 = [0, 185469197, 370938394, 487725847, 741876788, 657...
list U3 = [0, 218828297, 437656594, 387781147, 875313188, 958...
list U4 = [0, 151849742, 303699484, 454499602, 607398968, 758...

Variable Details

num_rounds

Type:
dict
Value:
{16: {16: 10, 24: 12, 32: 14},
 24: {16: 12, 24: 12, 32: 14},
 32: {16: 14, 24: 14, 32: 14}}                                         

rcon

Type:
list
Value:
[1, 2, 4, 8, 16, 32, 64, 128, 27]                                      

S

Type:
list
Value:
[99, 124, 119, 123, 242, 107, 111, 197, 48]                            

shifts

Type:
list
Value:
[[[0, 0], [1, 3], [2, 2], [3, 1]],
 [[0, 0], [1, 5], [2, 4], [3, 3]],
 [[0, 0], [1, 7], [3, 5], [4, 4]]]                                     

Si

Type:
list
Value:
[82, 9, 106, 213, 48, 54, 165, 56, 191]                                

T1

Type:
list
Value:
[-966564955,
 -126059388,
 -294160487,
 -159679603,
 -855539,
 -697603139,
 -563122255,
 -1849309868,
...                                                                    

T2

Type:
list
Value:
[-1513725085,
 -2064089988,
 -1712425097,
 -1913226373,
 234877682,
 -1110021269,
 -1310822545,
 1418839493,
...                                                                    

T3

Type:
list
Value:
[1671808611,
 2089089148,
 2006576759,
 2072901243,
 -233963534,
 1807603307,
 1873927791,
 -984313403,
...                                                                    

T4

Type:
list
Value:
[1667474886,
 2088535288,
 2004326894,
 2071694838,
 -219017729,
 1802223062,
 1869591006,
 -976923503,
...                                                                    

T5

Type:
list
Value:
[1374988112,
 2118214995,
 437757123,
 975658646,
 1001089995,
 530400753,
 -1392879445,
 1273168787,
...                                                                    

T6

Type:
list
Value:
[1347548327,
 1400783205,
 -1021700188,
 -1774573730,
 -885281941,
 -249586363,
 -1414727080,
 -1823743229,
...                                                                    

T7

Type:
list
Value:
[-1487908364,
 1699970625,
 -1530717673,
 1586903591,
 1808481195,
 1173430173,
 1487645946,
 59984867,
...                                                                    

T8

Type:
list
Value:
[-190361519,
 1097159550,
 396673818,
 660510266,
 -1418998981,
 -1656360673,
 -94852180,
 -486304949,
...                                                                    

U1

Type:
list
Value:
[0,
 235474187,
 470948374,
 303765277,
 941896748,
 908933415,
 607530554,
 708780849,
...                                                                    

U2

Type:
list
Value:
[0,
 185469197,
 370938394,
 487725847,
 741876788,
 657861945,
 975451694,
 824852259,
...                                                                    

U3

Type:
list
Value:
[0,
 218828297,
 437656594,
 387781147,
 875313188,
 958871085,
 775562294,
 590424639,
...                                                                    

U4

Type:
list
Value:
[0,
 151849742,
 303699484,
 454499602,
 607398968,
 758720310,
 908999204,
 1059270954,
...                                                                    

Generated by Epydoc 2.0 on Mon Feb 21 21:56:55 2005 http://epydoc.sf.net