This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://jsbin.com/rasuwilojo/6/edit?js,console | |
(async () => { | |
///////////////////////////////////////////////////////////////// | |
// Instead of logging in with actual users, we are | |
// going to generate SEA pairs which is basically the same thing | |
///////////////////////////////////////////////////////////////// | |
// User 1 encrypts one message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////// | |
// On my side - logged in as myself | |
/////////////////////////////////// | |
var myPair = gun.user()._.sea; | |
// retrieve bob's user | |
var bob = gun.user(bobPublicKey); | |
// generate encryption secret using bob's epub and my pair | |
// this means only bob will be able to generate this secret | |
var secret = await SEA.secret(bob.epub, myPair) | |
// encrypt the data using the secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
declare(strict_types = 1); | |
// require_once ('hhb_.inc.php'); | |
hhb_init (); | |
if ($argc !== 3) { | |
fprintf ( STDERR, "usage: %s timestamp url\n", $argv [0] ); | |
fprintf ( STDERR, "example: %s 20091012061648 http://www.p4w.se\n", $argv [0] ); | |
die ( 1 ); | |
} |