Skip to content

Commit 3ad4827

Browse files
authored
Switch to generating shorter, more secure ed25519 keys (#365)
1 parent 177ebc1 commit 3ad4827

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webroot/js/ajax/ssh_generate.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
require "../../../resources/autoload.php";
44

5-
use phpseclib3\Crypt\RSA;
5+
use phpseclib3\Crypt\EC;
66

77
echo "<pre>";
88

9-
$private = RSA::createKey(2048);
9+
$private = EC::createKey('Ed25519');
1010
$public = $private->getPublicKey();
1111

1212
echo "<section class='pubKey'>";
@@ -16,7 +16,7 @@
1616
if (isset($_GET["type"]) && $_GET["type"] == "ppk") {
1717
echo $private->toString('PuTTY');
1818
} else {
19-
echo $private;
19+
echo $private->toString('OpenSSH');
2020
}
2121
echo "</section>";
2222

0 commit comments

Comments
 (0)