-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.php
More file actions
32 lines (26 loc) · 751 Bytes
/
example.php
File metadata and controls
32 lines (26 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
<title>Simple PHP ECC Front End Demo</title>
</head>
<body>
<h1>PHP ECC</h1>
<p>This demo genorates an EC keypair in HEX format using Matyas Danter's phpecc libraries.</p>
<?php
//Use base 256
define('MAX_BASE', 256);
//Force Either BCMATH or GMP, Autodetected otherwise, prefers GMP
//if(!defined('USE_EXT')) define ('USE_EXT', 'BCMATH');
//if(!defined('USE_EXT')) define ('USE_EXT', 'GMP');
include 'autoload.inc.php';
include 'classes/PHPECC.class.php';
include 'classes/SECurve.class.php';
$keypair = PHPECC::hex_keypair_genorate();
?>
<div>
<strong>Private Key</strong>: <pre><?php echo $keypair['private']; ?></pre>
</div>
<div>
<strong>Public Key</strong>: <pre><?php echo $keypair['public']; ?></pre>
</div>
</body>
</html>