Package DebTorrent :: Module BTcrypto
[hide private]
[frames] | no frames]

Module BTcrypto

source code

Encrypted communication support.

Classes [hide private]
  Crypto
Functions [hide private]
long
bytetonum(x)
Convert a long number in a string to a number.
source code
string
numtobyte(x)
Convert a very large number to a string.
source code
Variables [hide private]
  CRYPTO_OK = True
int KEY_LENGTH = 160
the length of the keys to generate
long DH_PRIME = 155251809230070893513091813125848175563133404943451...
a very large prime number
int PAD_MAX = 200
the maximum amount of padding to add to the encryptes protocol header
int DH_BYTES = 96
the number of bytes to use for key lengths

Imports: random.randrange, random.randint, random.seed, urandom, sha.sha, Crypto.Cipher.ARC4


Function Details [hide private]

bytetonum(x)

source code 
Convert a long number in a string to a number.
Parameters:
  • x (string) - the data to convert
Returns: long
the converted data

numtobyte(x)

source code 
Convert a very large number to a string.
Parameters:
  • x (long) - the number to convert
Returns: string
the string representation of the number

Variables Details [hide private]

DH_PRIME

a very large prime number
Type:
long
Value:
1552518092300708935130918131258481755631334049434514313202351194902966\
2399491021072586694538765916424429100076802888642291508037189180463426\
3272761303128298374438082089019628850917069131659317536746955176311984\
3371637221007211169123