Package flumotion :: Package extern :: Module unixcrypt
[hide private]

Module unixcrypt

source code

this module supposedly emulates the unix crypt() routine.

don't ask me how it works, because I have no clue. I just ported Crypt::UnixCrypt from perl into python.. :)

encryptedtext = crypt(plaintext, salt)

NOTE: supposedly, it doesn't work the same way unix does when salt is not in [A-Za-z0-9./]{2}

0423.2000: I CAN't get this working. I'm going to try porting Crypt::PasswdMD5...

Functions [hide private]
 
ushr(n, s)
only for ints! (mimics the Java >>> operator)
source code
 
toByte(value)
this turns value into a shortint..
source code
 
toInt(value) source code
 
byteToUnsigned(value) source code
 
fourBytesToInt(b, offset) source code
 
intToFourBytes(iValue, b, offset) source code
 
PERM_OP(a, b, n, m, results) source code
 
HPERM_OP(a, n, m) source code
 
des_set_key(key) source code
 
D_ENCRYPT(L, R, S, E0, E1, s) source code
 
body(schedule, Eswap0, Eswap1) source code
 
crypt(plaintext, salt) source code
Variables [hide private]
  ITERATIONS = 16
  con_salt = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
  shifts2 = (0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0)
  skb0 = (0, 16, 536870912, 536870928, 65536, 65552, 536936448, ...
  skb1 = (0, 33554432, 8192, 33562624, 2097152, 35651584, 210534...
  skb2 = (0, 1, 262144, 262145, 16777216, 16777217, 17039360, 17...
  skb3 = (0, 1048576, 256, 1048832, 8, 1048584, 264, 1048840, 40...
  skb4 = (0, 268435456, 65536, 268500992, 4, 268435460, 65540, 2...
  skb5 = (0, 134217728, 8, 134217736, 1024, 134218752, 1032, 134...
  skb6 = (0, 256, 524288, 524544, 16777216, 16777472, 17301504, ...
  skb7 = (0, 67108864, 262144, 67371008, 2, 67108866, 262146, 67...
  SPtrans0 = (8520192, 131072, 2155872256, 2156003840, 8388608, ...
  SPtrans1 = (268705796, 0, 270336, 268697600, 268435460, 8196, ...
  SPtrans2 = (1090519040, 16842816, 64, 1090519104, 1073807360, ...
  SPtrans3 = (1049602, 67109888, 2, 68158466, 0, 68157440, 67109...
  SPtrans4 = (33554432, 16384, 256, 33571080, 33570824, 33554688...
  SPtrans5 = (536870928, 524304, 0, 537397248, 524304, 2048, 536...
  SPtrans6 = (4096, 128, 4194432, 4194305, 4198529, 4097, 4224, ...
  SPtrans7 = (136314912, 136347648, 32800, 0, 134250496, 2097184...
  cov_2char = (46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 6...
Variables Details [hide private]

con_salt

Value:
(0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
...

skb0

Value:
(0,
 16,
 536870912,
 536870928,
 65536,
 65552,
 536936448,
 536936464,
...

skb1

Value:
(0,
 33554432,
 8192,
 33562624,
 2097152,
 35651584,
 2105344,
 35659776,
...

skb2

Value:
(0,
 1,
 262144,
 262145,
 16777216,
 16777217,
 17039360,
 17039361,
...

skb3

Value:
(0,
 1048576,
 256,
 1048832,
 8,
 1048584,
 264,
 1048840,
...

skb4

Value:
(0,
 268435456,
 65536,
 268500992,
 4,
 268435460,
 65540,
 268500996,
...

skb5

Value:
(0,
 134217728,
 8,
 134217736,
 1024,
 134218752,
 1032,
 134218760,
...

skb6

Value:
(0,
 256,
 524288,
 524544,
 16777216,
 16777472,
 17301504,
 17301760,
...

skb7

Value:
(0,
 67108864,
 262144,
 67371008,
 2,
 67108866,
 262146,
 67371010,
...

SPtrans0

Value:
(8520192,
 131072,
 2155872256,
 2156003840,
 8388608,
 2147615232,
 2147614720,
 2155872256,
...

SPtrans1

Value:
(268705796,
 0,
 270336,
 268697600,
 268435460,
 8196,
 268443648,
 270336,
...

SPtrans2

Value:
(1090519040,
 16842816,
 64,
 1090519104,
 1073807360,
 16777216,
 1090519104,
 65600,
...

SPtrans3

Value:
(1049602,
 67109888,
 2,
 68158466,
 0,
 68157440,
 67109890,
 1048578,
...

SPtrans4

Value:
(33554432,
 16384,
 256,
 33571080,
 33570824,
 33554688,
 16648,
 33570816,
...

SPtrans5

Value:
(536870928,
 524304,
 0,
 537397248,
 524304,
 2048,
 536872976,
 524288,
...

SPtrans6

Value:
(4096,
 128,
 4194432,
 4194305,
 4198529,
 4097,
 4224,
 0,
...

SPtrans7

Value:
(136314912,
 136347648,
 32800,
 0,
 134250496,
 2097184,
 136314880,
 136347680,
...

cov_2char

Value:
(46,
 47,
 48,
 49,
 50,
 51,
 52,
 53,
...