Alternc  latest
Alternc logiel libre pour l'hébergement
m_crypto Class Reference

Public Member Functions

 encrypt ($sValue, $sSecretKey)
 
 decrypt ($sValue, $sSecretKey)
 

Detailed Description

Definition at line 3 of file m_crypto.php.

Member Function Documentation

◆ decrypt()

m_crypto::decrypt (   $sValue,
  $sSecretKey 
)

Definition at line 19 of file m_crypto.php.

19  {
20  return rtrim(
21  mcrypt_decrypt(
22  MCRYPT_RIJNDAEL_256, $sSecretKey, base64_decode($sValue), MCRYPT_MODE_ECB, mcrypt_create_iv(
23  mcrypt_get_iv_size(
24  MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB
25  ), MCRYPT_RAND
26  )
27  ), "\0"
28  );
29  }

◆ encrypt()

m_crypto::encrypt (   $sValue,
  $sSecretKey 
)

Definition at line 5 of file m_crypto.php.

5  {
6  return rtrim(
7  base64_encode(
8  mcrypt_encrypt(
9  MCRYPT_RIJNDAEL_256, $sSecretKey, $sValue, MCRYPT_MODE_ECB, mcrypt_create_iv(
10  mcrypt_get_iv_size(
11  MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB
12  ), MCRYPT_RAND
13  )
14  )
15  ), "\0"
16  );
17  }

The documentation for this class was generated from the following file: