-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.html
More file actions
1141 lines (957 loc) Β· 33.7 KB
/
README.html
File metadata and controls
1141 lines (957 loc) Β· 33.7 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ping - Decentralized E2E Encrypted Messenger</title>
<style>
:root {
--bg-primary: #0d1117;
--bg-secondary: #161b22;
--bg-tertiary: #21262d;
--text-primary: #e6edf3;
--text-secondary: #8b949e;
--text-muted: #6e7681;
--accent-blue: #90FE8E; /* #58a6ff */
--accent-green: #3fb950;
--accent-purple: #a371f7;
--accent-orange: #d29922;
--accent-red: #f85149;
--border-color: #30363d;
--code-bg: #1a1f26;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
padding: 20px;
max-width: 1000px;
margin: 0 auto;
}
/* Header */
.header {
text-align: center;
padding: 40px 0;
border-bottom: 1px solid var(--border-color);
margin-bottom: 40px;
}
.header h1 {
font-size: 2.5em;
margin-bottom: 10px;
color: var(--text-primary);
}
.header h1 .emoji {
margin-right: 10px;
}
.tagline {
font-size: 1.2em;
color: var(--accent-blue);
margin-bottom: 20px;
}
.subtitle {
color: var(--text-secondary);
font-style: italic;
margin-bottom: 20px;
}
/* Badges */
.badges {
display: flex;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
margin-bottom: 20px;
}
.badge {
display: inline-block;
padding: 5px 12px;
border-radius: 20px;
font-size: 0.85em;
font-weight: 500;
}
.badge-blue { background: #1f6feb; color: white; }
.badge-purple { background: #8957e5; color: white; }
.badge-green { background: #238636; color: white; }
.badge-orange { background: #9e6a03; color: white; }
/* Screenshot placeholder */
.screenshot-placeholder {
background: var(--bg-secondary);
border: 2px dashed var(--border-color);
border-radius: 10px;
padding: 60px 20px;
text-align: center;
color: var(--text-muted);
margin: 20px 0;
}
/* Sections */
section {
margin-bottom: 50px;
}
h2 {
font-size: 1.8em;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 1px solid var(--border-color);
color: var(--text-primary);
}
h2 .emoji {
margin-right: 10px;
}
h3 {
font-size: 1.3em;
margin: 25px 0 15px 0;
color: var(--text-primary);
}
h3 .emoji {
margin-right: 8px;
}
p {
margin-bottom: 15px;
color: var(--text-secondary);
}
/* Feature Grid */
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin: 20px 0;
}
.feature-card {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 10px;
padding: 25px;
}
.feature-card h3 {
margin-top: 0;
color: var(--accent-blue);
}
.feature-card ul {
list-style: none;
padding: 0;
}
.feature-card li {
padding: 8px 0;
color: var(--text-secondary);
border-bottom: 1px solid var(--bg-tertiary);
}
.feature-card li:last-child {
border-bottom: none;
}
.feature-card li strong {
color: var(--text-primary);
}
/* Tables */
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
background: var(--bg-secondary);
border-radius: 10px;
overflow: hidden;
}
th, td {
padding: 12px 15px;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
th {
background: var(--bg-tertiary);
color: var(--text-primary);
font-weight: 600;
}
td {
color: var(--text-secondary);
}
tr:last-child td {
border-bottom: none;
}
tr:hover {
background: var(--bg-tertiary);
}
/* Code blocks */
pre {
background: var(--code-bg);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 16px;
overflow-x: auto;
margin: 15px 0;
}
code {
font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
font-size: 0.9em;
color: var(--accent-green);
}
pre code {
color: var(--text-primary);
}
.comment {
color: var(--text-muted);
}
/* Inline code */
p code, td code, li code {
background: var(--bg-tertiary);
padding: 2px 6px;
border-radius: 4px;
font-size: 0.85em;
}
/* Alerts/Notes */
.note {
background: rgba(56, 139, 253, 0.1);
border: 1px solid rgba(56, 139, 253, 0.4);
border-radius: 8px;
padding: 15px 20px;
margin: 20px 0;
}
.note strong {
color: var(--accent-blue);
}
.warning {
background: rgba(210, 153, 34, 0.1);
border: 1px solid rgba(210, 153, 34, 0.4);
border-radius: 8px;
padding: 15px 20px;
margin: 20px 0;
}
.warning strong {
color: var(--accent-orange);
}
/* Diagram */
.diagram {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 10px;
padding: 30px;
margin: 20px 0;
font-family: 'SF Mono', 'Fira Code', monospace;
font-size: 0.85em;
line-height: 1.4;
overflow-x: auto;
white-space: pre;
color: var(--text-secondary);
}
/* Command reference table */
.command-table td:first-child {
white-space: nowrap;
}
.command-table code {
color: var(--accent-green);
}
/* Footer */
.footer {
text-align: center;
padding: 40px 0;
border-top: 1px solid var(--border-color);
margin-top: 50px;
}
.footer-links {
margin-bottom: 20px;
}
.footer-links a {
color: var(--accent-blue);
text-decoration: none;
margin: 0 15px;
}
.footer-links a:hover {
text-decoration: underline;
}
.footer-sub {
color: var(--text-muted);
font-size: 0.9em;
}
/* Responsive */
@media (max-width: 600px) {
body {
padding: 15px;
}
.header h1 {
font-size: 1.8em;
}
.feature-grid {
grid-template-columns: 1fr;
}
table {
font-size: 0.85em;
}
th, td {
padding: 8px 10px;
}
pre {
padding: 12px;
font-size: 0.8em;
}
}
/* Links */
a {
color: var(--accent-blue);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* Lists */
ul, ol {
margin: 15px 0;
padding-left: 25px;
color: var(--text-secondary);
}
li {
margin-bottom: 8px;
}
/* Horizontal rule */
hr {
border: none;
border-top: 1px solid var(--border-color);
margin: 40px 0;
}
/* Table of Contents */
.toc {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 10px;
padding: 25px 30px;
margin: 30px 0;
}
.toc h3 {
margin-bottom: 15px;
color: var(--text-primary);
font-size: 1.1em;
}
.toc-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 10px 30px;
}
.toc a {
display: block;
padding: 5px 0;
color: var(--text-secondary);
text-decoration: none;
font-size: 0.95em;
transition: color 0.2s;
}
.toc a:hover {
color: var(--accent-blue);
}
.toc a .emoji {
margin-right: 8px;
}
/* Message Flow Steps */
.flow-step {
background: var(--bg-secondary);
border-left: 3px solid var(--accent-blue);
padding: 15px 20px;
margin: 15px 0;
border-radius: 0 8px 8px 0;
}
.flow-step-number {
display: inline-block;
background: var(--accent-blue);
color: var(--bg-primary);
width: 24px;
height: 24px;
border-radius: 50%;
text-align: center;
line-height: 24px;
font-weight: bold;
font-size: 0.85em;
margin-right: 10px;
}
.flow-step h4 {
display: inline;
color: var(--text-primary);
font-size: 1em;
}
.flow-step p {
margin: 10px 0 0 34px;
color: var(--text-secondary);
font-size: 0.9em;
}
/* Algorithm Summary */
.algo-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 15px;
margin: 20px 0;
}
.algo-card {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 15px 20px;
}
.algo-card h4 {
color: var(--accent-blue);
font-size: 0.9em;
margin-bottom: 8px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.algo-card code {
color: var(--text-primary);
font-size: 1em;
}
</style>
</head>
<body>
<!-- Header -->
<header class="header">
<h1><span class="emoji">π</span>Ping</h1>
<p class="tagline">Decentralized End-to-End Encrypted Messenger</p>
<div class="badges">
<span class="badge badge-blue">Python 3.12+</span>
<span class="badge badge-purple">ANSI Terminal</span>
<span class="badge badge-green">E2E Encrypted</span>
<span class="badge badge-orange">Nostr Relays</span>
</div>
<p class="subtitle">Serverless, Trustless, Attacless Private Messaging.</p>
<!-- Screenshot placeholder -->
<div class="screenshot-placeholder">
πΈ Screenshot placeholder β Add demo.png here
</div>
</header>
<!-- Table of Contents -->
<nav class="toc">
<h3>π Table of Contents</h3>
<div class="toc-grid">
<a href="#features"><span class="emoji">β¨</span>Features</a>
<a href="#security"><span class="emoji">π‘οΈ</span>Security</a>
<a href="#installation"><span class="emoji">π¦</span>Installation</a>
<a href="#usage"><span class="emoji">π</span>Usage</a>
<a href="#themes"><span class="emoji">π¨</span>Themes</a>
<a href="#identity"><span class="emoji">πΎ</span>Identity Management</a>
<a href="#updates"><span class="emoji">π</span>Updates</a>
<a href="#mobile"><span class="emoji">π±</span>Mobile Usage</a>
<a href="#how-it-works"><span class="emoji">π</span>How It Works</a>
<a href="#contributing"><span class="emoji">π€</span>Contributing</a>
<a href="#license"><span class="emoji">π</span>License</a>
<a href="#acknowledgments"><span class="emoji">π</span>Acknowledgments</a>
</div>
</nav>
<!-- Features -->
<section id="features">
<h2><span class="emoji">β¨</span>Features</h2>
<div class="feature-grid">
<div class="feature-card">
<h3>π Privacy First</h3>
<ul>
<li><strong>End-to-end encryption</strong> with X25519 + ChaCha20-Poly1305</li>
<li><strong>Ephemeral chat sessions</strong> new keys each session by default</li>
<li><strong>No accounts</strong> no email, no phone, no registration</li>
<li><strong>No metadata</strong> encrypted envelopes hide message patterns</li>
</ul>
</div>
<div class="feature-card">
<h3>π Truly Decentralized</h3>
<ul>
<li><strong>Nostr protocol</strong> censorship-resistant relay network</li>
<li><strong>No central server</strong> messages route through public relays</li>
<li><strong>Works offline-first</strong> reconnects automatically</li>
<li><strong>Self-hosted option</strong> run your own relay</li>
</ul>
</div>
<div class="feature-card">
<h3>π¬ Features</h3>
<ul>
<li><strong>Room based</strong> group chats</li>
<li><strong>Direct messages</strong> between peers</li>
<li><strong>Password-protected</strong> rooms</li>
<li><strong>Invite codes</strong> with QR generation</li>
<li><strong>Sound notifications</strong> with mention detection</li>
</ul>
</div>
<div class="feature-card">
<h3>π¨ Customizable</h3>
<ul>
<li><strong>20+ color themes</strong> (matrix, tron, amber, etc.)</li>
<li><strong>Custom colors</strong> set any bg/fg combination</li>
<li><strong>Portable</strong> single Python file, no install needed</li>
<li><strong>Cross-platform</strong> Linux, macOS, Windows, mobile</li>
</ul>
</div>
</div>
</section>
<hr>
<!-- Security -->
<section id="security">
<h2><span class="emoji">π‘οΈ</span>Security</h2>
<p>Ping uses a modern cryptographic stack:</p>
<table>
<thead>
<tr>
<th>Layer</th>
<th>Algorithm</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td>Key Exchange</td>
<td><strong>X25519 ECDH</strong></td>
<td>Derive shared secrets</td>
</tr>
<tr>
<td>Encryption</td>
<td><strong>ChaCha20-Poly1305</strong></td>
<td>Authenticated encryption</td>
</tr>
<tr>
<td>Key Derivation</td>
<td><strong>HKDF-SHA256</strong></td>
<td>Expand shared secret</td>
</tr>
<tr>
<td>Nostr Identity</td>
<td><strong>secp256k1 Schnorr</strong></td>
<td>Sign Nostr events</td>
</tr>
</tbody>
</table>
<h3>Privacy Modes</h3>
<table>
<thead>
<tr>
<th>Mode</th>
<th>Flag</th>
<th>Protection Level</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Default</strong></td>
<td><code>β</code></td>
<td>Encrypted envelopes + ephemeral Nostr keys</td>
</tr>
<tr>
<td><strong>Hardened</strong></td>
<td><code>--hardened</code></td>
<td>Default + decoy traffic + timing jitter</td>
</tr>
<tr>
<td><strong>Legacy</strong></td>
<td><code>--legacy</code></td>
<td>E2E encryption only</td>
</tr>
</tbody>
</table>
</section>
<hr>
<!-- Installation -->
<section id="installation">
<h2><span class="emoji">π¦</span>Installation</h2>
<h3>Prerequisites</h3>
<ul>
<li>Python 3.12 or higher</li>
<li>pip (Python package manager)</li>
</ul>
<h3>Quick Install</h3>
<pre><code><span class="comment"># Clone the repository</span>
git clone https://github.com/yourusername/ping-e2e.git
cd ping-e2e
<span class="comment"># Install dependencies</span>
pip install cryptography websockets certifi
<span class="comment"># Optional: faster crypto (recommended)</span>
pip install secp256k1
<span class="comment"># or</span>
pip install coincurve
<span class="comment"># Optional: QR code generation</span>
pip install qrcode</code></pre>
<h3>One-Line Install</h3>
<pre><code>curl -O https://raw.githubusercontent.com/attacless/ping/main/ping.py && pip install cryptography websockets certifi && python ping.py</code></pre>
<h3>Dependencies</h3>
<table>
<thead>
<tr>
<th>Package</th>
<th>Required</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>cryptography</code></td>
<td>β
Yes</td>
<td>X25519, ChaCha20-Poly1305, HKDF</td>
</tr>
<tr>
<td><code>websockets</code></td>
<td>β
Yes</td>
<td>Nostr relay connections</td>
</tr>
<tr>
<td><code>certifi</code></td>
<td>β
Yes</td>
<td>SSL certificates</td>
</tr>
<tr>
<td><code>secp256k1</code></td>
<td>β Recommended</td>
<td>Fast Schnorr signatures</td>
</tr>
<tr>
<td><code>coincurve</code></td>
<td>π Alternative</td>
<td>Schnorr signatures</td>
</tr>
<tr>
<td><code>qrcode</code></td>
<td>π± Optional</td>
<td>QR invite codes</td>
</tr>
</tbody>
</table>
<div class="note">
<strong>Note:</strong> If neither <code>secp256k1</code> nor <code>coincurve</code> is installed, Ping falls back to a pure Python implementation (slower but works everywhere).
</div>
</section>
<hr>
<!-- Usage -->
<section id="usage">
<h2><span class="emoji">π</span>Usage</h2>
<h3>Basic Usage</h3>
<pre><code><span class="comment"># Start Ping (interactive mode)</span>
python ping.py
<span class="comment"># Join a room directly</span>
python ping.py -r myroom
<span class="comment"># Join a password-protected room</span>
python ping.py -r secretroom -p mypassword
<span class="comment"># Join via invite code</span>
python ping.py -i ping1eyJyIjoibXlyb29tIn0</code></pre>
<h3>Command Line Options</h3>
<pre><code>python ping.py [OPTIONS]
Options:
-r, --room ROOM Join a room on startup
-p, --password PASS Room password
-i, --invite CODE Join via invite code
-u, --username NAME Set your display name
-c, --color THEME Set color theme (e.g., matrix, tron)
-l, --load Load identity from pingconfig.json
--persist Persistent mode (save to ~/.ping-data)
--legacy Legacy mode (compatible with old clients)
--hardened Hardened privacy mode
--no-sound Disable sound notifications
--update Check for and install updates
-d, --debug Show debug output
-v, --version Show version</code></pre>
<h3>Chat Commands</h3>
<p>Once inside Ping, use these commands:</p>
<table class="command-table">
<thead>
<tr>
<th>Category</th>
<th>Command</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="5"><strong>Room</strong></td>
<td><code>/join <room> [pass]</code></td>
<td>Join a room (with optional password)</td>
</tr>
<tr>
<td><code>/leave</code></td>
<td>Leave current room</td>
</tr>
<tr>
<td><code>/invite</code></td>
<td>Generate invite code + QR</td>
</tr>
<tr>
<td><code>/peers</code></td>
<td>Show connected peers</td>
</tr>
<tr>
<td><code>/reconnect</code></td>
<td>Reconnect to relays</td>
</tr>
<tr>
<td rowspan="2"><strong>Chat</strong></td>
<td><code>/dm <user> <msg></code></td>
<td>Send direct message</td>
</tr>
<tr>
<td><code>/name <username></code></td>
<td>Change display name</td>
</tr>
<tr>
<td rowspan="4"><strong>View</strong></td>
<td><code>/info</code></td>
<td>Show session info</td>
</tr>
<tr>
<td><code>/relays</code></td>
<td>Show relay status</td>
</tr>
<tr>
<td><code>/printsession</code></td>
<td>Show encryption keys</td>
</tr>
<tr>
<td><code>/clear</code></td>
<td>Clear screen</td>
</tr>
<tr>
<td rowspan="2"><strong>Config</strong></td>
<td><code>/color [theme]</code></td>
<td>Set colors (<code>/color themes</code> for list)</td>
</tr>
<tr>
<td><code>/sound [on|off]</code></td>
<td>Toggle sound notifications</td>
</tr>
<tr>
<td rowspan="4"><strong>Data</strong></td>
<td><code>/save</code></td>
<td>Export user session to pingconfig.json</td>
</tr>
<tr>
<td><code>/load</code></td>
<td>Import user session from pingconfig.json</td>
</tr>
<tr>
<td><code>/update</code></td>
<td>Check for updates</td>
</tr>
<tr>
<td><code>/wipe</code></td>
<td>Delete all local data</td>
</tr>
<tr>
<td><strong>Exit</strong></td>
<td><code>/quit</code></td>
<td>Exit Ping</td>
</tr>
</tbody>
</table>
</section>
<hr>
<!-- Themes -->
<section id="themes">
<h2><span class="emoji">π¨</span>Themes</h2>
<p>Ping includes 20+ built-in color themes:</p>
<pre><code><span class="comment"># Apply a theme</span>
/color matrix <span class="comment"># Green on black (hacker style)</span>
/color tron <span class="comment"># Cyan on black</span>
/color amber <span class="comment"># Yellow on black (CRT monitor)</span>
/color ocean <span class="comment"># Cyan on blue</span>
<span class="comment"># Custom colors</span>
/color blue white <span class="comment"># Blue background, white text</span>
/color - lgreen <span class="comment"># Keep background, light green text</span>
<span class="comment"># Reset to default</span>
/color reset</code></pre>
<!-- Theme screenshots placeholder -->
<div class="screenshot-placeholder">
πΈ Theme screenshots placeholder β Add theme previews here
</div>
<p><strong>Available themes:</strong> <code>matrix</code>, <code>tron</code>, <code>classic</code>, <code>amber</code>, <code>light</code>, <code>ocean</code>, <code>sunset</code>, <code>grape</code>, <code>snow</code>, <code>midnight</code>, <code>coffee</code>, and more.</p>
</section>
<hr>
<!-- Session Management -->
<section id="identity">
<h2><span class="emoji">πΎ</span>Session Management</h2>
<p>By default, Ping runs in <strong>ephemeral mode</strong> a new keyset is generated each session for maximum privacy.</p>
<h3>Saving Your Keys</h3>
<pre><code><span class="comment"># Save current user session to pingconfig.json</span>
/save
<span class="comment"># Load user on next run</span>
python ping.py --load</code></pre>
<h3>Persistent Mode</h3>
<pre><code><span class="comment"># Always use the same user session (stored in ~/.ping-data)</span>
python ping.py --persist</code></pre>
<h3>Config File Format</h3>
<p>The <code>pingconfig.json</code> file contains your user session keys:</p>
<pre><code>{
"version": 1,
"identity": {
"nostr_private_key": "base64...",
"nostr_public_key": "hex...",
"npub": "npub1...",
"encryption_private_key": "base64...",
"encryption_public_key": "base64...",
"ping_id": "abcd1234",
"created_at": 1234567890
},
"username": "cosmic-wolf-123",
"exported_at": 1234567890
}</code></pre>
<div class="warning">
<strong>β οΈ Keep this file secure!</strong> Anyone with access to it can impersonate you.
</div>
</section>
<hr>
<!-- Updates -->
<section id="updates">
<h2><span class="emoji">π</span>Updates</h2>
<p>Ping can update itself:</p>
<pre><code><span class="comment"># From command line</span>
python ping.py --update
<span class="comment"># From within Ping</span>
/update</code></pre>
<p>After updating, you'll be prompted to restart automatically.</p>
</section>
<hr>
<!-- Mobile -->
<section id="mobile">
<h2><span class="emoji">π±</span>Ping on Mobile</h2>
<p>Ping works great on mobile terminal apps like <strong>Termux</strong> (Android) or <strong>a-Shell mini</strong> (iOS):</p>
<pre><code><span class="comment"># Install on Termux</span>
pkg install python
pip install cryptography websockets certifi
curl -O https://raw.githubusercontent.com/attacless/ping/main/ping.py
python ping.py</code></pre>
<div class="note">
<strong>Tip:</strong> Use <code>--no-sound</code> if terminal bells are annoying on mobile.
</div>
</section>
<hr>
<!-- How It Works -->
<section id="how-it-works">
<h2><span class="emoji">π</span>How It Works</h2>
<p>Ping uses the Nostr protocol for decentralized message relay, with end-to-end encryption ensuring only the intended recipients can read messages.</p>
<h3>Architecture Overview</h3>
<div class="diagram">βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Alice β β Nostr β β Bob β
β (ping.py) ββββββΆβ Relays βββββββ (ping.py) β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β β β
β 1. Key Exchange (signed, public) β
ββββββββββββββββββββββββββββββββββββββββΆβ
β β
β 2. Encrypted Messages (E2E) β
βββββββββββββββββββββββββββββββββββββββββΆβ
β (Only Alice & Bob can decrypt) β</div>
<h3>Complete Message Flow</h3>
<p>When Alice sends a message to Bob, here's exactly what happens:</p>
<div class="flow-step">
<span class="flow-step-number">1</span>
<h4>Create Message Payload</h4>
<p>Alice's message is packaged with metadata: content, timestamp, username, and a unique ID.</p>
</div>
<div class="flow-step">
<span class="flow-step-number">2</span>
<h4>ECDH Key Agreement</h4>
<p>Alice combines her X25519 private key with Bob's public key to derive a shared secret. Bob can compute the same secret using his private key + Alice's public key.</p>
</div>
<div class="flow-step">
<span class="flow-step-number">3</span>
<h4>Key Derivation (HKDF)</h4>
<p>The shared secret is expanded using HKDF-SHA256 with the info string <code>ping-nostr-chacha20poly1305-v1</code> to produce the encryption key.</p>