gdata.tlslite.utils.rijndael
index
/usr/lib/python2.7/dist-packages/gdata/tlslite/utils/rijndael.py

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

 
Modules
       
copy
exceptions
os
string
warnings

 
Classes
       
rijndael

 
class rijndael
     Methods defined here:
__init__(self, key, block_size=16)
decrypt(self, ciphertext)
encrypt(self, plaintext)

 
Functions
       
decrypt(key, block)
encrypt(key, block)
test()

 
Data
        S = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, ...]
Si = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, ...]
T1 = [3328402341L, 4168907908L, 4000806809L, 4135287693L, 4294111757L, 3597364157L, 3731845041L, 2445657428L, 1613770832, 33620227, 3462883241L, 1445669757, 3892248089L, 3050821474L, 1303096294, 3967186586L, 2412431941L, 528646813, 2311702848L, 4202528135L, ...]
T2 = [2781242211L, 2230877308L, 2582542199L, 2381740923L, 234877682, 3184946027L, 2984144751L, 1418839493, 1348481072, 50462977, 2848876391L, 2102799147, 434634494, 1656084439, 3863849899L, 2599188086L, 1167051466, 2636087938L, 1082771913, 2281340285L, ...]
T3 = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762L, 1807603307, 1873927791, 3310653893L, 810573872, 16974337, 1739181671, 729634347, 4263110654L, 3613570519L, 2883997099L, 1989864566, 3393556426L, 2191335298L, 3376449993L, 2106063485, ...]
T4 = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567L, 1802223062, 1869591006, 3318043793L, 808472672, 16843522, 1734846926, 724270422, 4278065639L, 3621216949L, 2880169549L, 1987484396, 3402253711L, 2189597983L, 3385409673L, 2105378810, ...]
T5 = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851L, 1273168787, 540080725, 2910219766L, 2295101073L, 4110568485L, 1340463100, 3307916247L, 641025152, 3043140495L, 3736164937L, 632953703, 1172967064, 1576976609, ...]
T6 = [1347548327, 1400783205, 3273267108L, 2520393566L, 3409685355L, 4045380933L, 2880240216L, 2471224067L, 1428173050, 4138563181L, 2441661558L, 636813900, 4233094615L, 3620022987L, 2149987652L, 2411029155L, 1239331162, 1730525723, 2554718734L, 3781033664L, ...]
T7 = [2807058932L, 1699970625, 2764249623L, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800L, 1844882806, 1989249228, 1277555970, 3623636965L, 3419915562L, 1149249077, 2744104290L, 1514790577, 459744698, 244860394, 3235995134L, ...]
T8 = [4104605777L, 1097159550, 396673818, 660510266, 2875968315L, 2638606623L, 4200115116L, 3808662347L, 821712160, 1986918061, 3430322568L, 38544885, 3856137295L, 718002117, 893681702, 1654886325, 2975484382L, 3122358053L, 3926825029L, 4274053469L, ...]
U1 = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992L, 4003061179L, 4236429990L, 4069246893L, ...]
U2 = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152L, 3152976349L, 2801566410L, 2918353863L, ...]
U3 = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752L, 3720081049L, 3399941250L, 3350065803L, ...]
U4 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872L, 2581445614L, 2194319100L, 2345119218L, ...]
num_rounds = {16: {16: 10, 24: 12, 32: 14}, 24: {16: 12, 24: 12, 32: 14}, 32: {16: 14, 24: 14, 32: 14}}
rcon = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, ...]
shifts = [[[0, 0], [1, 3], [2, 2], [3, 1]], [[0, 0], [1, 5], [2, 4], [3, 3]], [[0, 0], [1, 7], [3, 5], [4, 4]]]