PageRenderTime 46ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/phalcon/devtools/ide/1.2.3/Phalcon/Crypt.php

https://gitlab.com/habracoder/advertising
PHP | 179 lines | 30 code | 42 blank | 107 comment | 0 complexity | 6ca43b1b4d0e267169da6765cc294d41 MD5 | raw file
  1. <?php
  2. namespace Phalcon {
  3. /**
  4. * Phalcon\Crypt
  5. *
  6. * Provides encryption facilities to phalcon applications
  7. *
  8. *<code>
  9. * $crypt = new Phalcon\Crypt();
  10. *
  11. * $key = 'le password';
  12. * $text = 'This is a secret text';
  13. *
  14. * $encrypted = $crypt->encrypt($text, $key);
  15. *
  16. * echo $crypt->decrypt($encrypted, $key);
  17. *</code>
  18. */
  19. class Crypt implements \Phalcon\CryptInterface {
  20. const PADDING_DEFAULT = 0;
  21. const PADDING_ANSI_X_923 = 1;
  22. const PADDING_PKCS7 = 2;
  23. const PADDING_ISO_10126 = 3;
  24. const PADDING_ISO_IEC_7816_4 = 4;
  25. const PADDING_ZERO = 5;
  26. const PADDING_SPACE = 6;
  27. protected $_key;
  28. protected $_mode;
  29. protected $_cipher;
  30. protected $_padding;
  31. /**
  32. * Sets the cipher algorithm
  33. *
  34. * @param string $cipher
  35. * @return \Phalcon\Encrypt
  36. */
  37. public function setCipher($cipher){ }
  38. /**
  39. * Returns the current cipher
  40. *
  41. * @return string
  42. */
  43. public function getCipher(){ }
  44. /**
  45. * Sets the encrypt/decrypt mode
  46. *
  47. * @param string $cipher
  48. * @return \Phalcon\Encrypt
  49. */
  50. public function setMode($mode){ }
  51. /**
  52. * Returns the current encryption mode
  53. *
  54. * @return string
  55. */
  56. public function getMode(){ }
  57. /**
  58. * Sets the encryption key
  59. *
  60. * @param string $key
  61. * @return \Phalcon\Encrypt
  62. */
  63. public function setKey($key){ }
  64. /**
  65. * Returns the encryption key
  66. *
  67. * @return string
  68. */
  69. public function getKey(){ }
  70. /**
  71. * @brief \Phalcon\CryptInterface \Phalcon\Crypt::setPadding(int $scheme)
  72. *
  73. * @param int scheme Padding scheme
  74. * @return \Phalcon\CryptInterface
  75. */
  76. public function setPadding($scheme){ }
  77. /**
  78. * Returns the padding scheme
  79. *
  80. * @brief int \Phalcon\Crypt::getPadding()
  81. * @return int
  82. */
  83. public function getPadding(){ }
  84. /**
  85. * Encrypts a text
  86. *
  87. *<code>
  88. * $encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");
  89. *</code>
  90. *
  91. * @param string $text
  92. * @param string $key
  93. * @return string
  94. */
  95. public function encrypt($text, $key=null){ }
  96. /**
  97. * Decrypts an encrypted text
  98. *
  99. *<code>
  100. * echo $crypt->decrypt($encrypted, "decrypt password");
  101. *</code>
  102. *
  103. * @param string $text
  104. * @param string $key
  105. * @return string
  106. */
  107. public function decrypt($text, $key=null){ }
  108. /**
  109. * Encrypts a text returning the result as a base64 string
  110. *
  111. * @param string $text
  112. * @param string $key
  113. * @return string
  114. */
  115. public function encryptBase64($text, $key=null){ }
  116. /**
  117. * Decrypt a text that is coded as a base64 string
  118. *
  119. * @param string $text
  120. * @param string $key
  121. * @return string
  122. */
  123. public function decryptBase64($text, $key=null){ }
  124. /**
  125. * Returns a list of available cyphers
  126. *
  127. * @return array
  128. */
  129. public function getAvailableCiphers(){ }
  130. /**
  131. * Returns a list of available modes
  132. *
  133. * @return array
  134. */
  135. public function getAvailableModes(){ }
  136. }
  137. }