Debian Codegraph @

codelitephp/resources/cc/mcrypt.php

raw
1 <?php
2
3 // Start of mcrypt v.
4
5 /**
6 * Deprecated: Encrypts/decrypts data in ECB mode
7 * @link http://www.php.net/manual/en/function.mcrypt-ecb.php
8 * @param cipher int
9 * @param key string
10 * @param data string
11 * @param mode int
12 * @return string
13 */
14 function mcrypt_ecb ($cipher, $key, $data, $mode) {}
15
16 /**
17 * Encrypts/decrypts data in CBC mode
18 * @link http://www.php.net/manual/en/function.mcrypt-cbc.php
19 * @param cipher int
20 * @param key string
21 * @param data string
22 * @param mode int
23 * @param iv string[optional]
24 * @return string
25 */
26 function mcrypt_cbc ($cipher, $key, $data, $mode, $iv = null) {}
27
28 /**
29 * Encrypts/decrypts data in CFB mode
30 * @link http://www.php.net/manual/en/function.mcrypt-cfb.php
31 * @param cipher int
32 * @param key string
33 * @param data string
34 * @param mode int
35 * @param iv string
36 * @return string
37 */
38 function mcrypt_cfb ($cipher, $key, $data, $mode, $iv) {}
39
40 /**
41 * Encrypts/decrypts data in OFB mode
42 * @link http://www.php.net/manual/en/function.mcrypt-ofb.php
43 * @param cipher int
44 * @param key string
45 * @param data string
46 * @param mode int
47 * @param iv string
48 * @return string
49 */
50 function mcrypt_ofb ($cipher, $key, $data, $mode, $iv) {}
51
52 /**
53 * Gets the key size of the specified cipher
54 * @link http://www.php.net/manual/en/function.mcrypt-get-key-size.php
55 * @param cipher int &mcrypt.parameter.cipher;
56 * @return int the maximum supported key size of the algorithm in bytes
57 * &return.falseforfailure;.
58 */
59 function mcrypt_get_key_size ($cipher) {}
60
61 /**
62 * Gets the block size of the specified cipher
63 * @link http://www.php.net/manual/en/function.mcrypt-get-block-size.php
64 * @param cipher int &mcrypt.parameter.cipher;
65 * @return int Gets the block size, as an integer.
66 */
67 function mcrypt_get_block_size ($cipher) {}
68
69 /**
70 * Gets the name of the specified cipher
71 * @link http://www.php.net/manual/en/function.mcrypt-get-cipher-name.php
72 * @param cipher int &mcrypt.parameter.cipher;
73 * @return string This function returns the name of the cipher or false if the cipher does
74 * not exist.
75 */
76 function mcrypt_get_cipher_name ($cipher) {}
77
78 /**
79 * Creates an initialization vector (IV) from a random source
80 * @link http://www.php.net/manual/en/function.mcrypt-create-iv.php
81 * @param size int <p>
82 * The size of the IV.
83 * </p>
84 * @param source int[optional] <p>
85 * The source of the IV. The source can be
86 * MCRYPT_RAND (system random number generator),
87 * MCRYPT_DEV_RANDOM (read data from
88 * /dev/random) and
89 * MCRYPT_DEV_URANDOM (read data from
90 * /dev/urandom). Prior to 5.3.0,
91 * MCRYPT_RAND was the only one supported on Windows.
92 * </p>
93 * <p>
94 * Note that the default value of this parameter was
95 * MCRYPT_DEV_RANDOM prior to PHP 5.6.0.
96 * </p>
97 * @return string the initialization vector, or false on error.
98 */
99 function mcrypt_create_iv ($size, $source = null) {}
100
101 /**
102 * Gets an array of all supported ciphers
103 * @link http://www.php.net/manual/en/function.mcrypt-list-algorithms.php
104 * @param lib_dir string[optional] <p>
105 * Specifies the directory where all algorithms are located. If not
106 * specified, the value of the mcrypt.algorithms_dir
107 * &php.ini; directive is used.
108 * </p>
109 * @return array an array with all the supported algorithms.
110 */
111 function mcrypt_list_algorithms ($lib_dir = null) {}
112
113 /**
114 * Gets an array of all supported modes
115 * @link http://www.php.net/manual/en/function.mcrypt-list-modes.php
116 * @param lib_dir string[optional] <p>
117 * Specifies the directory where all modes are located. If not
118 * specified, the value of the mcrypt.modes_dir
119 * &php.ini; directive is used.
120 * </p>
121 * @return array an array with all the supported modes.
122 */
123 function mcrypt_list_modes ($lib_dir = null) {}
124
125 /**
126 * Returns the size of the IV belonging to a specific cipher/mode combination
127 * @link http://www.php.net/manual/en/function.mcrypt-get-iv-size.php
128 * @param cipher string &mcrypt.parameter.cipher;
129 * @param mode string &mcrypt.parameter.mode;
130 * <p>
131 * The IV is ignored in ECB mode as this mode does not require it. You will
132 * need to have the same IV (think: starting point) both at encryption and
133 * decryption stages, otherwise your encryption will fail.
134 * </p>
135 * @return int the size of the Initialization Vector (IV) in bytes. On error the
136 * function returns false. If the IV is ignored in the specified cipher/mode
137 * combination zero is returned.
138 */
139 function mcrypt_get_iv_size ($cipher, $mode) {}
140
141 /**
142 * Encrypts plaintext with given parameters
143 * @link http://www.php.net/manual/en/function.mcrypt-encrypt.php
144 * @param cipher string &mcrypt.parameter.cipher;
145 * @param key string <p>
146 * The key with which the data will be encrypted. If it's smaller than
147 * the required keysize, it is padded with '\0'. It is
148 * better not to use ASCII strings for keys.
149 * </p>
150 * <p>
151 * It is recommended to use the mhash functions to create a key from a
152 * string.
153 * </p>
154 * @param data string <p>
155 * The data that will be encrypted with the given cipher
156 * and mode. If the size of the data is not n * blocksize,
157 * the data will be padded with '\0'.
158 * </p>
159 * <p>
160 * The returned crypttext can be larger than the size of the data that was
161 * given by data.
162 * </p>
163 * @param mode string &mcrypt.parameter.mode;
164 * @param iv string[optional] &mcrypt.parameter.iv;
165 * @return string the encrypted data, as a string.
166 */
167 function mcrypt_encrypt ($cipher, $key, $data, $mode, $iv = null) {}
168
169 /**
170 * Decrypts crypttext with given parameters
171 * @link http://www.php.net/manual/en/function.mcrypt-decrypt.php
172 * @param cipher string &mcrypt.parameter.cipher;
173 * @param key string <p>
174 * The key with which the data was encrypted. If it's smaller
175 * than the required keysize, it is padded with
176 * '\0'.
177 * </p>
178 * @param data string <p>
179 * The data that will be decrypted with the given cipher
180 * and mode. If the size of the data is not n * blocksize,
181 * the data will be padded with '\0'.
182 * </p>
183 * @param mode string &mcrypt.parameter.mode;
184 * @param iv string[optional] &mcrypt.parameter.iv;
185 * @return string the decrypted data as a string.
186 */
187 function mcrypt_decrypt ($cipher, $key, $data, $mode, $iv = null) {}
188
189 /**
190 * Opens the module of the algorithm and the mode to be used
191 * @link http://www.php.net/manual/en/function.mcrypt-module-open.php
192 * @param algorithm string &mcrypt.parameter.cipher;
193 * @param algorithm_directory string <p>
194 * The algorithm_directory parameter is used to locate
195 * the encryption module. When you supply a directory name, it is used. When
196 * you set it to an empty string (""), the value set by the
197 * mcrypt.algorithms_dir &php.ini; directive is used. When
198 * it is not set, the default directory that is used is the one that was compiled
199 * into libmcrypt (usually /usr/local/lib/libmcrypt).
200 * </p>
201 * @param mode string &mcrypt.parameter.mode;
202 * @param mode_directory string <p>
203 * The mode_directory parameter is used to locate
204 * the encryption module. When you supply a directory name, it is used. When
205 * you set it to an empty string (""), the value set by the
206 * mcrypt.modes_dir &php.ini; directive is used. When
207 * it is not set, the default directory that is used is the one that was compiled-in
208 * into libmcrypt (usually /usr/local/lib/libmcrypt).
209 * </p>
210 * @return resource Normally it returns an encryption descriptor, or false on error.
211 */
212 function mcrypt_module_open ($algorithm, $algorithm_directory, $mode, $mode_directory) {}
213
214 /**
215 * This function initializes all buffers needed for encryption
216 * @link http://www.php.net/manual/en/function.mcrypt-generic-init.php
217 * @param td resource <p>
218 * The encryption descriptor.
219 * </p>
220 * @param key string <p>
221 * The maximum length of the key should be the one obtained by calling
222 * mcrypt_enc_get_key_size and every value smaller
223 * than this is legal.
224 * </p>
225 * @param iv string <p>
226 * The IV should normally have the size of the algorithms block size, but
227 * you must obtain the size by calling
228 * mcrypt_enc_get_iv_size. IV is ignored in ECB. IV
229 * MUST exist in CFB, CBC, STREAM, nOFB and OFB modes. It needs to be
230 * random and unique (but not secret). The same IV must be used for
231 * encryption/decryption. If you do not want to use it you should set it
232 * to zeros, but this is not recommended.
233 * </p>
234 * @return int The function returns a negative value on error: -3 when the key length
235 * was incorrect, -4 when there was a memory allocation problem and any
236 * other return value is an unknown error. If an error occurs a warning will
237 * be displayed accordingly. false is returned if incorrect parameters
238 * were passed.
239 */
240 function mcrypt_generic_init ($td, $key, $iv) {}
241
242 /**
243 * This function encrypts data
244 * @link http://www.php.net/manual/en/function.mcrypt-generic.php
245 * @param td resource <p>
246 * The encryption descriptor.
247 * </p>
248 * <p>
249 * The encryption handle should always be initialized with
250 * mcrypt_generic_init with a key and an IV before
251 * calling this function. Where the encryption is done, you should free the
252 * encryption buffers by calling mcrypt_generic_deinit.
253 * See mcrypt_module_open for an example.
254 * </p>
255 * @param data string <p>
256 * The data to encrypt.
257 * </p>
258 * @return string the encrypted data.
259 */
260 function mcrypt_generic ($td, $data) {}
261
262 /**
263 * Decrypts data
264 * @link http://www.php.net/manual/en/function.mdecrypt-generic.php
265 * @param td resource <p>
266 * An encryption descriptor returned by
267 * mcrypt_module_open
268 * </p>
269 * @param data string <p>
270 * Encrypted data.
271 * </p>
272 * @return string
273 */
274 function mdecrypt_generic ($td, $data) {}
275
276 /**
277 * This function terminates encryption
278 * @link http://www.php.net/manual/en/function.mcrypt-generic-end.php
279 * @param td resource
280 * @return bool
281 */
282 function mcrypt_generic_end ($td) {}
283
284 /**
285 * This function deinitializes an encryption module
286 * @link http://www.php.net/manual/en/function.mcrypt-generic-deinit.php
287 * @param td resource <p>
288 * The encryption descriptor.
289 * </p>
290 * @return bool Returns true on success, false on failure.
291 */
292 function mcrypt_generic_deinit ($td) {}
293
294 /**
295 * Runs a self test on the opened module
296 * @link http://www.php.net/manual/en/function.mcrypt-enc-self-test.php
297 * @param td resource <p>
298 * The encryption descriptor.
299 * </p>
300 * @return int If the self test succeeds it returns false. In case of an error, it
301 * returns true.
302 */
303 function mcrypt_enc_self_test ($td) {}
304
305 /**
306 * Checks whether the encryption of the opened mode works on blocks
307 * @link http://www.php.net/manual/en/function.mcrypt-enc-is-block-algorithm-mode.php
308 * @param td resource <p>
309 * The encryption descriptor.
310 * </p>
311 * @return bool true if the mode is for use with block algorithms, otherwise it
312 * returns false.
313 */
314 function mcrypt_enc_is_block_algorithm_mode ($td) {}
315
316 /**
317 * Checks whether the algorithm of the opened mode is a block algorithm
318 * @link http://www.php.net/manual/en/function.mcrypt-enc-is-block-algorithm.php
319 * @param td resource <p>
320 * The encryption descriptor.
321 * </p>
322 * @return bool true if the algorithm is a block algorithm or false if it is
323 * a stream one.
324 */
325 function mcrypt_enc_is_block_algorithm ($td) {}
326
327 /**
328 * Checks whether the opened mode outputs blocks
329 * @link http://www.php.net/manual/en/function.mcrypt-enc-is-block-mode.php
330 * @param td resource <p>
331 * The encryption descriptor.
332 * </p>
333 * @return bool true if the mode outputs blocks of bytes,
334 * or false if it outputs just bytes.
335 */
336 function mcrypt_enc_is_block_mode ($td) {}
337
338 /**
339 * Returns the blocksize of the opened algorithm
340 * @link http://www.php.net/manual/en/function.mcrypt-enc-get-block-size.php
341 * @param td resource <p>
342 * The encryption descriptor.
343 * </p>
344 * @return int the block size of the specified algorithm in bytes.
345 */
346 function mcrypt_enc_get_block_size ($td) {}
347
348 /**
349 * Returns the maximum supported keysize of the opened mode
350 * @link http://www.php.net/manual/en/function.mcrypt-enc-get-key-size.php
351 * @param td resource <p>
352 * The encryption descriptor.
353 * </p>
354 * @return int the maximum supported key size of the algorithm in bytes.
355 */
356 function mcrypt_enc_get_key_size ($td) {}
357
358 /**
359 * Returns an array with the supported keysizes of the opened algorithm
360 * @link http://www.php.net/manual/en/function.mcrypt-enc-get-supported-key-sizes.php
361 * @param td resource <p>
362 * The encryption descriptor.
363 * </p>
364 * @return array an array with the key sizes supported by the algorithm
365 * specified by the encryption descriptor. If it returns an empty
366 * array then all key sizes between 1 and
367 * mcrypt_enc_get_key_size are supported by the
368 * algorithm.
369 */
370 function mcrypt_enc_get_supported_key_sizes ($td) {}
371
372 /**
373 * Returns the size of the IV of the opened algorithm
374 * @link http://www.php.net/manual/en/function.mcrypt-enc-get-iv-size.php
375 * @param td resource <p>
376 * The encryption descriptor.
377 * </p>
378 * @return int the size of the IV, or 0 if the IV is ignored by the algorithm.
379 */
380 function mcrypt_enc_get_iv_size ($td) {}
381
382 /**
383 * Returns the name of the opened algorithm
384 * @link http://www.php.net/manual/en/function.mcrypt-enc-get-algorithms-name.php
385 * @param td resource <p>
386 * The encryption descriptor.
387 * </p>
388 * @return string the name of the opened algorithm as a string.
389 */
390 function mcrypt_enc_get_algorithms_name ($td) {}
391
392 /**
393 * Returns the name of the opened mode
394 * @link http://www.php.net/manual/en/function.mcrypt-enc-get-modes-name.php
395 * @param td resource <p>
396 * The encryption descriptor.
397 * </p>
398 * @return string the name as a string.
399 */
400 function mcrypt_enc_get_modes_name ($td) {}
401
402 /**
403 * This function runs a self test on the specified module
404 * @link http://www.php.net/manual/en/function.mcrypt-module-self-test.php
405 * @param algorithm string &mcrypt.parameter.cipher;
406 * @param lib_dir string[optional] <p>
407 * The optional lib_dir parameter can contain the
408 * location where the algorithm module is on the system.
409 * </p>
410 * @return bool The function returns true if the self test succeeds, or false when it
411 * fails.
412 */
413 function mcrypt_module_self_test ($algorithm, $lib_dir = null) {}
414
415 /**
416 * Returns if the specified module is a block algorithm or not
417 * @link http://www.php.net/manual/en/function.mcrypt-module-is-block-algorithm-mode.php
418 * @param mode string <p>
419 * The mode to check.
420 * </p>
421 * @param lib_dir string[optional] <p>
422 * The optional lib_dir parameter can contain the
423 * location where the algorithm module is on the system.
424 * </p>
425 * @return bool This function returns true if the mode is for use with block
426 * algorithms, otherwise it returns false. (e.g. false for stream, and
427 * true for cbc, cfb, ofb).
428 */
429 function mcrypt_module_is_block_algorithm_mode ($mode, $lib_dir = null) {}
430
431 /**
432 * This function checks whether the specified algorithm is a block algorithm
433 * @link http://www.php.net/manual/en/function.mcrypt-module-is-block-algorithm.php
434 * @param algorithm string <p>
435 * The algorithm to check.
436 * </p>
437 * @param lib_dir string[optional] <p>
438 * The optional lib_dir parameter can contain the
439 * location where the algorithm module is on the system.
440 * </p>
441 * @return bool This function returns true if the specified algorithm is a block
442 * algorithm, or false if it is a stream one.
443 */
444 function mcrypt_module_is_block_algorithm ($algorithm, $lib_dir = null) {}
445
446 /**
447 * Returns if the specified mode outputs blocks or not
448 * @link http://www.php.net/manual/en/function.mcrypt-module-is-block-mode.php
449 * @param mode string &mcrypt.parameter.mode;
450 * @param lib_dir string[optional] <p>
451 * The optional lib_dir parameter can contain the
452 * location where the algorithm module is on the system.
453 * </p>
454 * @return bool This function returns true if the mode outputs blocks of bytes or
455 * false if it outputs just bytes. (e.g. true for cbc and ecb, and
456 * false for cfb and stream).
457 */
458 function mcrypt_module_is_block_mode ($mode, $lib_dir = null) {}
459
460 /**
461 * Returns the blocksize of the specified algorithm
462 * @link http://www.php.net/manual/en/function.mcrypt-module-get-algo-block-size.php
463 * @param algorithm string <p>
464 * The algorithm name.
465 * </p>
466 * @param lib_dir string[optional] <p>
467 * This optional parameter can contain the location where the mode module
468 * is on the system.
469 * </p>
470 * @return int the block size of the algorithm specified in bytes.
471 */
472 function mcrypt_module_get_algo_block_size ($algorithm, $lib_dir = null) {}
473
474 /**
475 * Returns the maximum supported keysize of the opened mode
476 * @link http://www.php.net/manual/en/function.mcrypt-module-get-algo-key-size.php
477 * @param algorithm string <p>
478 * The algorithm name.
479 * </p>
480 * @param lib_dir string[optional] <p>
481 * This optional parameter can contain the location where the mode module
482 * is on the system.
483 * </p>
484 * @return int This function returns the maximum supported key size of the
485 * algorithm specified in bytes.
486 */
487 function mcrypt_module_get_algo_key_size ($algorithm, $lib_dir = null) {}
488
489 /**
490 * Returns an array with the supported keysizes of the opened algorithm
491 * @link http://www.php.net/manual/en/function.mcrypt-module-get-supported-key-sizes.php
492 * @param algorithm string <p>
493 * The algorithm to be used.
494 * </p>
495 * @param lib_dir string[optional] <p>
496 * The optional lib_dir parameter can contain the
497 * location where the algorithm module is on the system.
498 * </p>
499 * @return array an array with the key sizes supported by the specified algorithm.
500 * If it returns an empty array then all key sizes between 1 and
501 * mcrypt_module_get_algo_key_size are supported by the
502 * algorithm.
503 */
504 function mcrypt_module_get_supported_key_sizes ($algorithm, $lib_dir = null) {}
505
506 /**
507 * Closes the mcrypt module
508 * @link http://www.php.net/manual/en/function.mcrypt-module-close.php
509 * @param td resource <p>
510 * The encryption descriptor.
511 * </p>
512 * @return bool Returns true on success, false on failure.
513 */
514 function mcrypt_module_close ($td) {}
515
516 define ('MCRYPT_ENCRYPT', 0);
517 define ('MCRYPT_DECRYPT', 1);
518 define ('MCRYPT_DEV_RANDOM', 0);
519 define ('MCRYPT_DEV_URANDOM', 1);
520 define ('MCRYPT_RAND', 2);
521 define ('MCRYPT_3DES', "tripledes");
522 define ('MCRYPT_ARCFOUR_IV', "arcfour-iv");
523 define ('MCRYPT_ARCFOUR', "arcfour");
524 define ('MCRYPT_BLOWFISH', "blowfish");
525 define ('MCRYPT_BLOWFISH_COMPAT', "blowfish-compat");
526 define ('MCRYPT_CAST_128', "cast-128");
527 define ('MCRYPT_CAST_256', "cast-256");
528 define ('MCRYPT_CRYPT', "crypt");
529 define ('MCRYPT_DES', "des");
530 define ('MCRYPT_ENIGNA', "crypt");
531 define ('MCRYPT_GOST', "gost");
532 define ('MCRYPT_LOKI97', "loki97");
533 define ('MCRYPT_PANAMA', "panama");
534 define ('MCRYPT_RC2', "rc2");
535 define ('MCRYPT_RIJNDAEL_128', "rijndael-128");
536 define ('MCRYPT_RIJNDAEL_192', "rijndael-192");
537 define ('MCRYPT_RIJNDAEL_256', "rijndael-256");
538 define ('MCRYPT_SAFER64', "safer-sk64");
539 define ('MCRYPT_SAFER128', "safer-sk128");
540 define ('MCRYPT_SAFERPLUS', "saferplus");
541 define ('MCRYPT_SERPENT', "serpent");
542 define ('MCRYPT_THREEWAY', "threeway");
543 define ('MCRYPT_TRIPLEDES', "tripledes");
544 define ('MCRYPT_TWOFISH', "twofish");
545 define ('MCRYPT_WAKE', "wake");
546 define ('MCRYPT_XTEA', "xtea");
547 define ('MCRYPT_IDEA', "idea");
548 define ('MCRYPT_MARS', "mars");
549 define ('MCRYPT_RC6', "rc6");
550 define ('MCRYPT_SKIPJACK', "skipjack");
551 define ('MCRYPT_MODE_CBC', "cbc");
552 define ('MCRYPT_MODE_CFB', "cfb");
553 define ('MCRYPT_MODE_ECB', "ecb");
554 define ('MCRYPT_MODE_NOFB', "nofb");
555 define ('MCRYPT_MODE_OFB', "ofb");
556 define ('MCRYPT_MODE_STREAM', "stream");
557
558 // End of mcrypt v.
559 ?>