The Red Matrix
 All Classes Namespaces Files Functions Variables Pages
crypto.php File Reference

Functions

 rsa_sign ($data, $key, $alg= 'sha256')
 
 rsa_verify ($data, $sig, $key, $alg= 'sha256')
 
 pkcs5_pad ($text, $blocksize)
 
 pkcs5_unpad ($text)
 
 AES256CBC_encrypt ($data, $key, $iv)
 
 AES256CBC_decrypt ($data, $key, $iv)
 
 crypto_encapsulate ($data, $pubkey, $alg='aes256cbc')
 
 aes_encapsulate ($data, $pubkey)
 
 crypto_unencapsulate ($data, $prvkey)
 
 aes_unencapsulate ($data, $prvkey)
 
 new_keypair ($bits)
 
 pkcs1to8 ($oldkey, $len)
 
 pkcs8to1 ($oldkey, $len)
 
 DerToPem ($Der, $Private=false)
 
 DerToRsa ($Der)
 
 pkcs8_encode ($Modulus, $PublicExponent)
 
 pkcs1_encode ($Modulus, $PublicExponent)
 
 metopem ($m, $e)
 
 pubrsatome ($key, &$m, &$e)
 
 rsatopem ($key)
 
 pemtorsa ($key)
 
 pemtome ($key, &$m, &$e)
 
 metorsa ($m, $e)
 
 salmon_key ($pubkey)
 

Function Documentation

AES256CBC_decrypt (   $data,
  $key,
  $iv 
)

Referenced by aes_unencapsulate().

AES256CBC_encrypt (   $data,
  $key,
  $iv 
)

Referenced by aes_encapsulate().

aes_encapsulate (   $data,
  $pubkey 
)
aes_unencapsulate (   $data,
  $prvkey 
)
crypto_encapsulate (   $data,
  $pubkey,
  $alg = 'aes256cbc' 
)
DerToPem (   $Der,
  $Private = false 
)

Referenced by metopem().

DerToRsa (   $Der)

Referenced by metorsa().

metopem (   $m,
  $e 
)

Referenced by rsatopem().

metorsa (   $m,
  $e 
)

Referenced by pemtorsa().

new_keypair (   $bits)
pemtome (   $key,
$m,
$e 
)

Referenced by pemtorsa(), and salmon_key().

pemtorsa (   $key)

Referenced by xrd_init().

pkcs1_encode (   $Modulus,
  $PublicExponent 
)

Referenced by metorsa().

pkcs1to8 (   $oldkey,
  $len 
)
pkcs5_pad (   $text,
  $blocksize 
)
pkcs5_unpad (   $text)
pkcs8_encode (   $Modulus,
  $PublicExponent 
)

Referenced by metopem().

pkcs8to1 (   $oldkey,
  $len 
)
pubrsatome (   $key,
$m,
$e 
)

Referenced by rsatopem().

rsatopem (   $key)
salmon_key (   $pubkey)

Referenced by xrd_init().