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

Module rijndael

source code

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 [hide private]
rijndael
Functions [hide private]
 
decrypt(key, block) source code
 
encrypt(key, block) source code
 
test() source code
Variables [hide private]
  S = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 25...
  Si = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129...
  T1 = [3328402341, 4168907908, 4000806809, 4135287693, 42941117...
  T2 = [2781242211, 2230877308, 2582542199, 2381740923, 23487768...
  T3 = [1671808611, 2089089148, 2006576759, 2072901243, 40610037...
  T4 = [1667474886, 2088535288, 2004326894, 2071694838, 40759495...
  T5 = [1374988112, 2118214995, 437757123, 975658646, 1001089995...
  T6 = [1347548327, 1400783205, 3273267108, 2520393566, 34096853...
  T7 = [2807058932, 1699970625, 2764249623, 1586903591, 18084811...
  T8 = [4104605777, 1097159550, 396673818, 660510266, 2875968315...
  U1 = [0, 235474187, 470948374, 303765277, 941896748, 908933415...
  U2 = [0, 185469197, 370938394, 487725847, 741876788, 657861945...
  U3 = [0, 218828297, 437656594, 387781147, 875313188, 958871085...
  U4 = [0, 151849742, 303699484, 454499602, 607398968, 758720310...
  __package__ = 'tlslite.utils'
  num_rounds = {16: {16: 10, 24: 12, 32: 14}, 24: {16: 12, 24: 1...
  rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77...
  shifts = [[[0, 0], [1, 3], [2, 2], [3, 1]], [[0, 0], [1, 5], [...
Variables Details [hide private]

S

Value:
[99,
 124,
 119,
 123,
 242,
 107,
 111,
 197,
...

Si

Value:
[82,
 9,
 106,
 213,
 48,
 54,
 165,
 56,
...

T1

Value:
[3328402341,
 4168907908,
 4000806809,
 4135287693,
 4294111757,
 3597364157,
 3731845041,
 2445657428,
...

T2

Value:
[2781242211,
 2230877308,
 2582542199,
 2381740923,
 234877682,
 3184946027,
 2984144751,
 1418839493,
...

T3

Value:
[1671808611,
 2089089148,
 2006576759,
 2072901243,
 4061003762,
 1807603307,
 1873927791,
 3310653893,
...

T4

Value:
[1667474886,
 2088535288,
 2004326894,
 2071694838,
 4075949567,
 1802223062,
 1869591006,
 3318043793,
...

T5

Value:
[1374988112,
 2118214995,
 437757123,
 975658646,
 1001089995,
 530400753,
 2902087851,
 1273168787,
...

T6

Value:
[1347548327,
 1400783205,
 3273267108,
 2520393566,
 3409685355,
 4045380933,
 2880240216,
 2471224067,
...

T7

Value:
[2807058932,
 1699970625,
 2764249623,
 1586903591,
 1808481195,
 1173430173,
 1487645946,
 59984867,
...

T8

Value:
[4104605777,
 1097159550,
 396673818,
 660510266,
 2875968315,
 2638606623,
 4200115116,
 3808662347,
...

U1

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

U2

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

U3

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

U4

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

num_rounds

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

rcon

Value:
[1,
 2,
 4,
 8,
 16,
 32,
 64,
 128,
...

shifts

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]]]