BVB Source Codes

The latest thinkphp v5.2 work order system Show dhparams.php Source code

Return Download The latest thinkphp v5.2 work order system: download dhparams.php Source code - Download The latest thinkphp v5.2 work order system Source code - Type:.php
  1. <?php
  2. /**********************************************************\
  3. |                                                          |
  4. | The implementation of PHPRPC Protocol 3.0                |
  5. |                                                          |
  6. | dhparams.php                                             |
  7. |                                                          |
  8. | Release 3.0.1                                            |
  9. | Copyright by Team-PHPRPC                                 |
  10. |                                                          |
  11. | WebSite:  http://www.phprpc.org/                         |
  12. |           http://www.phprpc.net/                         |
  13. |           http://www.phprpc.com/                         |
  14. |           http://sourceforge.net/projects/php-rpc/       |
  15. |                                                          |
  16. | Authors:  Ma Bingyao <andot@ujn.edu.cn>                  |
  17. |                                                          |
  18. | This file may be distributed and/or modified under the   |
  19. | terms of the GNU General Public License (GPL) version    |
  20. | 2.0 as published by the Free Software Foundation and     |
  21. | appearing in the included file LICENSE.                  |
  22. |                                                          |
  23. \**********************************************************/
  24.  
  25. /* Diffie-Hellman Parameters for PHPRPC.
  26.  *
  27.  * Copyright: Ma Bingyao <andot@ujn.edu.cn>
  28.  * Version: 1.2
  29.  * LastModified: Apr 12, 2010
  30.  * This library is free.  You can redistribute it and/or modify it under GPL.
  31.  */
  32. class DHParams {
  33.     var $len;
  34.     var $dhParams;
  35.     function getNearest($n, $a) {
  36.         $j = 0;
  37.         $m = abs($a[0] - $n);
  38.         for ($i = 1; $i < count($a); $i++) {
  39.             $t = abs($a[$i] - $n);
  40.             if ($m > $t) {
  41.                 $m = $t;
  42.                 $j = $i;
  43.             }
  44.         }
  45.         return $a[$j];
  46.     }
  47.     function DHParams($len = 128) {
  48.         if (extension_loaded('gmp')) {
  49.             $a = array(96, 128, 160, 192, 256, 512, 768, 1024, 1536, 2048, 3072, 4096);
  50.         }
  51.         else if (extension_loaded('big_int')) {
  52.             $a = array(96, 128, 160, 192, 256, 512, 768, 1024, 1536);
  53.         }
  54.         else if (extension_loaded('bcmath')) {
  55.             $a = array(96, 128, 160, 192, 256, 512);
  56.         }
  57.         else {
  58.             $a = array(96, 128, 160);
  59.         }
  60.         $this->len = $this->getNearest($len, $a);
  61.         $dhParams = unserialize(file_get_contents("dhparams/{$this->len}.dhp", true));
  62.         $this->dhParams = $dhParams[mt_rand(0, count($dhParams) - 1)];
  63.     }
  64.     function getL() {
  65.         return $this->len;
  66.     }
  67.     function getP() {
  68.         return $this->dhParams['p'];
  69.     }
  70.     function getG() {
  71.         return $this->dhParams['g'];
  72.     }
  73.     function getDHParams() {
  74.         return $this->dhParams;
  75.     }
  76. }
  77. ?>
downloaddhparams.php Source code - Download The latest thinkphp v5.2 work order system Source code
Related Source Codes/Software:
V3.3.6 Workerman high-performance PHP Socket (framework) - High performance PHP Socket framework Workerman re... 2017-05-03
The phosphor meeting room reservation system MRBS (loop reservation v16.0) - The phosphor meeting room reservation system MRBS ... 2017-05-03
IDC v5.2.3 agent center - IDC Centre IDC for exploitation is a PHP+MySQL age... 2017-05-03
Zen master v9.0.1 project management software - Zen is the first domestic open source project mana... 2017-05-03
Ray speed v7.03 employee files management system - Employee files project is various, and some conten... 2017-05-03
HITCMS Haitian responsive electronic mechanical v3.0 foreign trade website source code - HITCMS Haitian response electronic machinery trade... 2017-05-03
Ray v7.02 speed survey system - Lightning speed survey system is a. NET+MSSQL deve... 2017-05-03
Cool HITCMS reactive black v3.0 enterprise website source code - HITCMS-Haitian response black enterprises website ... 2017-05-03
WebOA v17.2 network office automation system - WebOA network using b/s structure development of o... 2017-05-03
Pure imitation of han site source code, one a 】 【 c9cms kernel v1.0 - Generic http://www.wufazhuce.com/Han one · Config... 2017-05-04
zone.js - Implements Zones for JavaScript ... 2017-05-11
dragonfly - A Ruby gem for on-the-fly processing - suitable fo... 2017-05-11
oh-my-fish - The Fishshell Framework. 2017-05-11
canvas-lms - The open LMS by Instructure, Inc. 2017-05-11
ledger - Double-entry accounting system with a command-line... 2017-05-11
Python - My Python Examples http://w... 2017-05-11
blade - 2017-05-11
LaZagne - Credentials recovery project 2017-05-10
Pull-to-Refresh.Rentals-iOS - This project aims to provide a simple and customiz... 2017-05-10
spoon - Distributing instrumentation tests to all your And... 2017-05-10

 Back to top