-
Notifications
You must be signed in to change notification settings - Fork 0
/
camp2023-57085-eng-Fantastic_OPRFs_and_where_to_find_them_opus.srt
1728 lines (1296 loc) · 51.8 KB
/
camp2023-57085-eng-Fantastic_OPRFs_and_where_to_find_them_opus.srt
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
1
00:00:00,000 --> 00:00:10,000
[MUSIC]
2
00:00:10,000 --> 00:00:38,000
I'm very happy to announce to you a speaker who has a very long experience with pen testing,
3
00:00:38,000 --> 00:00:46,000
who's been doing crypto since he was a kid after he read a book that inspired him when he was a teenager.
4
00:00:46,000 --> 00:00:51,000
But he also told me that he doesn't want to talk about himself.
5
00:00:51,000 --> 00:00:56,000
He's here to talk about projects, but I even would recommend to check out his bio because
6
00:00:56,000 --> 00:01:03,000
Steph has really interesting projects done in his life, and I'm really, really happy that he's here today
7
00:01:03,000 --> 00:01:11,000
to show us, in his words, "cinematic version" of a talk that was already published on YouTube,
8
00:01:11,000 --> 00:01:16,000
where he's going to show the link afterwards where you can see the director's cut later,
9
00:01:16,000 --> 00:01:20,000
if you feel like your appetite was whetted.
10
00:01:20,000 --> 00:01:32,000
We are most likely not going to have a Q&A afterwards, but Steph will be available from 4 p.m. on in the House of T to do the Q&A.
11
00:01:32,000 --> 00:01:38,000
So, without further ado, please applause for Steph.
12
00:01:38,000 --> 00:01:42,000
[APPLAUSE]
13
00:01:42,000 --> 00:01:47,000
Hello. Hello. Can you hear me? Great. Hello. Welcome.
14
00:01:47,000 --> 00:01:53,000
This is going to be my little rabbit hole, and maybe some of you will also follow me down this rabbit hole.
15
00:01:53,000 --> 00:02:00,000
I don't have much time. There's a lot of really awesome stuff to be shown.
16
00:02:00,000 --> 00:02:09,000
So, there's two parts of this talk. First of all, I'm going to tell you a bit about how OPRFs work, what they can do.
17
00:02:09,000 --> 00:02:16,000
This is based on a very awesome paper by Casa Cubeta, Hesse and Lehmann, which is called "Systemization of Knowledge,"
18
00:02:16,000 --> 00:02:21,000
which I can warmly recommend to all of you. The reference is always in the footer.
19
00:02:21,000 --> 00:02:27,000
You can download the slides, and then if you are interested in this whole topic, this is a really good starting point, this paper.
20
00:02:27,000 --> 00:02:34,000
It has references to a lot of very exciting and very accessible papers, academic crypto papers.
21
00:02:34,000 --> 00:02:42,000
The second part is going to be some practical examples of software and deployments where OPRFs are deployed in the real world,
22
00:02:42,000 --> 00:02:47,000
or where you could think of deploying OPRFs yourself.
23
00:02:47,000 --> 00:02:52,000
Okay. First of all, just a little to whet your appetite, what you can do with OPRFs.
24
00:02:52,000 --> 00:02:58,000
OPRFs are essentially a building block for privacy. It's not so much about encryption or decryption or signing stuff.
25
00:02:58,000 --> 00:03:00,000
Of course, you can do those things as well.
26
00:03:00,000 --> 00:03:08,000
But here, oblivious keyword search is when you have a database which knows all the details in the database,
27
00:03:08,000 --> 00:03:11,000
but you don't want to disclose the queries to the database.
28
00:03:11,000 --> 00:03:15,000
So, you have a client, and you don't want the database to know what you are looking for.
29
00:03:15,000 --> 00:03:21,000
And so, keyword search is like a key value store where you go with a key and you get some value back
30
00:03:21,000 --> 00:03:27,000
if it's oblivious without the database actually learning what your query was, what the keyword was you were looking for.
31
00:03:27,000 --> 00:03:32,000
Private information retrieval is something similar, but here you don't go with a keyword or a key,
32
00:03:32,000 --> 00:03:36,000
but you know the index of the record in the database that you're querying, really.
33
00:03:36,000 --> 00:03:40,000
Secure pattern matching is when a server has like a string or something,
34
00:03:40,000 --> 00:03:43,000
and you're looking for a substring and the position of the substring,
35
00:03:43,000 --> 00:03:50,000
and you don't want the server to know what you're actually looking for while you actually learn the answer to your query.
36
00:03:50,000 --> 00:03:56,000
Private set intersection is also a very exciting topic that I'm going to come later in the practical example,
37
00:03:56,000 --> 00:03:58,000
so we're going to skip that.
38
00:03:58,000 --> 00:04:05,000
Also, password key exchange and cloud management and password storage are topics I'm going to come back later to.
39
00:04:05,000 --> 00:04:12,000
And the last four points I'm leaving up as an exercise for you to follow up, either reading the papers or something.
40
00:04:12,000 --> 00:04:16,000
These are also quite exciting topics that you can, for example,
41
00:04:16,000 --> 00:04:21,000
this is of course a non-exhaustive list of awesomeness that you can build from OPRFs.
42
00:04:21,000 --> 00:04:27,000
So first, let's have a look what a PRF is before we go into what an oblivious PRF is.
43
00:04:27,000 --> 00:04:35,000
So a pseudo-random function is basically a keyed function with a second input that generates some output
44
00:04:35,000 --> 00:04:39,000
that is non-distinguishable from random output.
45
00:04:39,000 --> 00:04:46,000
So if you want to imagine this, it's really like a hash with a key and a message,
46
00:04:46,000 --> 00:04:53,000
and the output is some hash value that is indistinguishable from random output.
47
00:04:53,000 --> 00:05:01,000
So it's like keyed hashing or calculating a Mac.
48
00:05:01,000 --> 00:05:04,000
Something happened with my slides.
49
00:05:04,000 --> 00:05:10,000
So it's like a keyed message authentication code, for example, or something like that.
50
00:05:10,000 --> 00:05:13,000
That's a pseudo-random function. Very simplified.
51
00:05:13,000 --> 00:05:17,000
There will be people who do crypto who will be screaming right now.
52
00:05:17,000 --> 00:05:21,000
But I think for this audience this might be enough.
53
00:05:21,000 --> 00:05:30,000
Okay, so this is a pseudo-random function.
54
00:05:30,000 --> 00:05:32,000
And if you do the same, so basically you have two inputs.
55
00:05:32,000 --> 00:05:37,000
You have a key and a message, and you have some output that is some random value, really.
56
00:05:37,000 --> 00:05:40,000
And if you do this in an oblivious setting, then you have two parties.
57
00:05:40,000 --> 00:05:44,000
You have a party that holds the key and another party that holds the message,
58
00:05:44,000 --> 00:05:53,000
and you compute a PRF together, but only the party who holds the message learns actually the output of the computation.
59
00:05:53,000 --> 00:05:59,000
So in this example here you don't see anything of my cursor.
60
00:05:59,000 --> 00:06:00,000
You see the cursor.
61
00:06:00,000 --> 00:06:03,000
Okay, so Alice has a message and Bob has the key,
62
00:06:03,000 --> 00:06:11,000
and they contribute the key and the message to this function, the OPRF function, and only Alice...
63
00:06:11,000 --> 00:06:19,000
So only Alice learns the output of this OPRF.
64
00:06:19,000 --> 00:06:27,000
This is like an interactive keyed hash, really, or a multi-party computation, if you want to consider it like that.
65
00:06:27,000 --> 00:06:31,000
So there's a bunch of techniques how you can create an OPRF.
66
00:06:31,000 --> 00:06:43,000
Basically, you have a PRF, and with some kind of conversion you can create an oblivious version of a PRF.
67
00:06:43,000 --> 00:06:47,000
The first that was possible to do so was in 2004, the Nowher Rangold,
68
00:06:47,000 --> 00:06:56,000
and there you apply oblivious transfer or homomorphic encryption, and then you have an OPRF.
69
00:06:56,000 --> 00:06:59,000
Then you have these others, but I'm not going to spend much time.
70
00:06:59,000 --> 00:07:04,000
This is something that you should either look in my director's cart.
71
00:07:04,000 --> 00:07:11,000
Shit. Ah, it's back.
72
00:07:11,000 --> 00:07:16,000
So these three constructions, I'm not going to go into much detail later.
73
00:07:16,000 --> 00:07:24,000
I'm going to refer to some of them, but the most exciting and most important one is the hash DH or two hash DH construction.
74
00:07:24,000 --> 00:07:31,000
It basically just calculates this very simple formula.
75
00:07:31,000 --> 00:07:36,000
If you see the one, I don't know how much you see the red part that is like the inner one,
76
00:07:36,000 --> 00:07:42,000
you have a special hash function that hashes your message to a point on a group.
77
00:07:42,000 --> 00:07:47,000
Most of the time, we are always working here with elliptic curves,
78
00:07:47,000 --> 00:07:56,000
so whatever you hash the message is going to be, after the hash, a point on an elliptic curve, on a specific elliptic curve.
79
00:07:56,000 --> 00:07:59,000
So this is not a normal hash. This is something we call hash to curve,
80
00:07:59,000 --> 00:08:06,000
and this just came out with the IRTF CFRG specification just this last week.
81
00:08:06,000 --> 00:08:13,000
So after 21 years of trying to define one that applies to all elliptic curves,
82
00:08:13,000 --> 00:08:17,000
also the NIST curves, not only the 25.519 derivates.
83
00:08:17,000 --> 00:08:25,000
So this is a very simple thing. You hash to a curve, and then you just raise to the secret key.
84
00:08:25,000 --> 00:08:29,000
And then there's a second variant of this. This is the two hash DH,
85
00:08:29,000 --> 00:08:34,000
where we hash the message again with the result of the hash DH construct.
86
00:08:34,000 --> 00:08:42,000
This is also very nice because the second hash destroys this algebraic structure that the hash DH has,
87
00:08:42,000 --> 00:08:45,000
which allows us to do some nifty stuff.
88
00:08:45,000 --> 00:08:56,000
But with the second hash, we actually get to a construct that can be proven in the universal composability framework,
89
00:08:56,000 --> 00:09:01,000
which is a very strong way to actually argue about protocols and constructs.
90
00:09:01,000 --> 00:09:03,000
Yes, there's a question.
91
00:09:03,000 --> 00:09:06,000
So, H prime and H are both elliptic curves?
92
00:09:06,000 --> 00:09:14,000
No, only H is a hash to curve. The second is just a normal hash and can be really any hash if you want.
93
00:09:14,000 --> 00:09:18,000
Very good question. The question was if those both are for elliptic curves,
94
00:09:18,000 --> 00:09:22,000
not just the inner one is for the elliptic curve or hash to the group, really.
95
00:09:22,000 --> 00:09:34,000
One thing. So the outer hash can also be memory-hard or cache-hard or any other hash function like argon2, for example.
96
00:09:34,000 --> 00:09:36,000
There's a follow-up question.
97
00:09:36,000 --> 00:09:39,000
So how do you convert the elliptic curve back to something you can have?
98
00:09:39,000 --> 00:09:51,000
Well, the elliptic curve in their serialized format, we usually use RESTRETO 255,
99
00:09:51,000 --> 00:09:57,000
and that is 32 bytes, really, and that's just 32 bytes. That's it.
100
00:09:57,000 --> 00:10:01,000
That's the most common way of actually doing that.
101
00:10:01,000 --> 00:10:04,000
Okay, so how do you instantiate this?
102
00:10:04,000 --> 00:10:14,000
So the client has the message and generates a random scalar R, and that is what we call the blinding factor.
103
00:10:14,000 --> 00:10:22,000
It just hashes to the curve of their message and then blinds this point by raising it to this blinding factor R.
104
00:10:22,000 --> 00:10:26,000
This we call alpha. Alpha is being sent over to the server.
105
00:10:26,000 --> 00:10:31,000
The server just raises this alpha value to K and then sends this beta value back.
106
00:10:31,000 --> 00:10:36,000
And then in the end, this is the -- I don't know how many of you people see this,
107
00:10:36,000 --> 00:10:46,000
but this beta value is then risen to 1 under R, and then the R eliminates the blinding, the raising to R here,
108
00:10:46,000 --> 00:10:50,000
and then raising to 1 under R here eliminates the whole blinding factor,
109
00:10:50,000 --> 00:11:01,000
and what you are left with in the end is actually exactly what hash DH was supposed to do.
110
00:11:01,000 --> 00:11:07,000
It's a very simple thing if you look at this, I think. The brilliance is also in the simplicity.
111
00:11:07,000 --> 00:11:12,000
Okay, so this is the base from which we are going to start,
112
00:11:12,000 --> 00:11:18,000
and we are going to look at a bunch of really exciting properties that you can build on top of this
113
00:11:18,000 --> 00:11:21,000
or that are actually inherent in this construction already.
114
00:11:21,000 --> 00:11:26,000
So the first thing that you can build from an OPRF is something we call a verifiable OPRF,
115
00:11:26,000 --> 00:11:34,000
and which is useful if you have some kind of iterated OPRF calculation,
116
00:11:34,000 --> 00:11:39,000
and you want to make sure that the server always uses the same K key correctly,
117
00:11:39,000 --> 00:11:46,000
and for that the server publishes a zero-knowledge proof that they actually used key correctly.
118
00:11:46,000 --> 00:11:58,000
This can be done for any OPRF really, but there are some OPRF constructions that lend themselves to more efficient proofs.
119
00:11:58,000 --> 00:12:05,000
So why is this useful? For example, imagine you want to have an OPRF calculation
120
00:12:05,000 --> 00:12:10,000
in which you provide privacy for yourself and the server cannot identify you later on.
121
00:12:10,000 --> 00:12:17,000
So imagine the case when the server is actually malicious and knows that you are you,
122
00:12:17,000 --> 00:12:22,000
but doesn't know who you will be in the future if it operates with this protocol correctly.
123
00:12:22,000 --> 00:12:26,000
So now that it knows that you are you and it wants to re-identify you,
124
00:12:26,000 --> 00:12:33,000
instead of using K that it's using for everyone else, it uses a specific K value only for you.
125
00:12:33,000 --> 00:12:38,000
And the next time you come and use this calculated OPRF value to the server,
126
00:12:38,000 --> 00:12:42,000
the server will see, "Oh, I'm not using the K value that I use for everyone,
127
00:12:42,000 --> 00:12:45,000
but I use this K value that I only use for you."
128
00:12:45,000 --> 00:12:49,000
And so this is how the server can later on anonymize you.
129
00:12:49,000 --> 00:12:56,000
And so for defending against this, you want to have a zero-knowledge proof that K has been used
130
00:12:56,000 --> 00:13:00,000
and verify OPRFs actually provide that.
131
00:13:00,000 --> 00:13:07,000
Okay, the next one as a property, as a partially oblivious pseudo-random function,
132
00:13:07,000 --> 00:13:10,000
this is exactly the same as the one that I showed you earlier.
133
00:13:10,000 --> 00:13:14,000
There's just one extra value. This is this tag T.
134
00:13:14,000 --> 00:13:20,000
This is a public value that also needs to go into the calculation of the OPRF.
135
00:13:20,000 --> 00:13:23,000
This might be known by the client and the server.
136
00:13:23,000 --> 00:13:26,000
This might be public. It might be sent over in any of that direction.
137
00:13:26,000 --> 00:13:29,000
But the thing is, this is a public value that is known by the server.
138
00:13:29,000 --> 00:13:32,000
This is not a secret value.
139
00:13:32,000 --> 00:13:37,000
And here you can see this is a very generic construction.
140
00:13:37,000 --> 00:13:45,000
This public value tag T is actually sent by the client to the server together with alpha.
141
00:13:45,000 --> 00:13:51,000
And then the server in this generic construction actually calculates a PRF.
142
00:13:51,000 --> 00:13:57,000
So this is the non-oblivious version. It's just a keyed hash, really.
143
00:13:57,000 --> 00:14:03,000
And it takes the input, the tag as the input for this PRF,
144
00:14:03,000 --> 00:14:09,000
and that generates a new key that is depending only on the tag and the key it has.
145
00:14:09,000 --> 00:14:12,000
And then that is being used instead of the key.
146
00:14:12,000 --> 00:14:15,000
So why is this useful? This might be useful, for example,
147
00:14:15,000 --> 00:14:21,000
if you have a username and the server wants to have a distinct key for each user.
148
00:14:21,000 --> 00:14:24,000
So in this case, the username would be the tag T.
149
00:14:24,000 --> 00:14:31,000
And this also helps the server, for example, to identify brute force attacks or to enable rate limiting.
150
00:14:31,000 --> 00:14:38,000
So if the server sees that user Bob has thousands of OPF evaluations per second,
151
00:14:38,000 --> 00:14:42,000
then it might say, hey, slow down mate.
152
00:14:42,000 --> 00:14:47,000
And so that allows rate limiting or any other security measure.
153
00:14:47,000 --> 00:14:49,000
Yes, there's another question.
154
00:14:49,000 --> 00:14:58,000
[inaudible]
155
00:14:58,000 --> 00:15:02,000
So the question was what R is.
156
00:15:02,000 --> 00:15:06,000
Yes, I am a bit sloppy in writing this down.
157
00:15:06,000 --> 00:15:14,000
It is a scalar on the field of... yes.
158
00:15:14,000 --> 00:15:18,000
So, okay, so that's the blinding factor. Yes, indeed.
159
00:15:18,000 --> 00:15:21,000
Okay, so that is a partially oblivious.
160
00:15:21,000 --> 00:15:25,000
You can combine these two with the verifiable and the partially oblivious one.
161
00:15:25,000 --> 00:15:29,000
But with hash DH, this is, especially in this way of its construction,
162
00:15:29,000 --> 00:15:33,000
is very difficult and not very efficient.
163
00:15:33,000 --> 00:15:39,000
Because for every key you need to publish a public key for the zero-knowledge proof.
164
00:15:39,000 --> 00:15:46,000
This other construction, this Dodis Jampols key, is actually one where this is efficiently possible.
165
00:15:46,000 --> 00:15:49,000
[inaudible]
166
00:15:49,000 --> 00:15:56,000
This construction is not very nice to combine to create a verifiable OPRF.
167
00:15:56,000 --> 00:16:05,000
Yes, yes. So there is more efficient constructions if you want to have a verifiable and partial OPRF.
168
00:16:05,000 --> 00:16:10,000
Okay, then you can have also the case when you want to do batching,
169
00:16:10,000 --> 00:16:18,000
which means you want to calculate an OPRF over multiple keys, like with the same message but with multiple keys.
170
00:16:18,000 --> 00:16:25,000
Or the other way around when you have multiple messages and you want to calculate them with the same key.
171
00:16:25,000 --> 00:16:30,000
And of course, if they can do batching, then that really means that this is more efficient
172
00:16:30,000 --> 00:16:33,000
than if you would do individual OPRF calculations.
173
00:16:33,000 --> 00:16:43,000
So this batching really is a performance property that is actually possible to achieve in some constructions.
174
00:16:43,000 --> 00:16:48,000
Okay, then a really nifty one is an updatable OPRF.
175
00:16:48,000 --> 00:16:54,000
In this case, you already have the results. So Alice has the result of a previous calculation of an OPRF.
176
00:16:54,000 --> 00:17:00,000
And then Bob says, "Shit, my key needs updating because it got compromised
177
00:17:00,000 --> 00:17:06,000
or because I'm just ratcheting my key, I need to regularly update my key."
178
00:17:06,000 --> 00:17:12,000
And so Alice doesn't want to recalculate a full OPRF with Bob with the new key.
179
00:17:12,000 --> 00:17:17,000
So with an updatable OPRF, Bob can send an update token
180
00:17:17,000 --> 00:17:26,000
so that Alice can update the previous calculation of the OPRF to be valid with the new key of Bob.
181
00:17:26,000 --> 00:17:34,000
And this is really simple, actually. So when Bob generates a new key, which is just a random number k',
182
00:17:34,000 --> 00:17:42,000
and then the update token, which we call delta, is simply just k' divided by k.
183
00:17:42,000 --> 00:17:49,000
And this update token doesn't disclose anything about neither the previous or the new key.
184
00:17:49,000 --> 00:17:56,000
And this delta is then sent to Alice, and she can apply this delta value to the previous result
185
00:17:56,000 --> 00:18:03,000
by just raising the previous result to delta, and the result will be as if she calculated the OPRF with k'.
186
00:18:03,000 --> 00:18:08,000
And I think this is a very elegant way. And this is also a way where you can actually...
187
00:18:08,000 --> 00:18:16,000
the update of the previous value can be done in a completely untrusted environment,
188
00:18:16,000 --> 00:18:21,000
which we will be in the practical part, we'll be seeing an example of.
189
00:18:21,000 --> 00:18:25,000
Then you have distributed OPRFs, where you don't have one key, but you have a bunch of keys,
190
00:18:25,000 --> 00:18:29,000
and all of them have to contribute to the calculation of the OPRF.
191
00:18:29,000 --> 00:18:36,000
This is really nice because an attacker, in this case, has to actually compromise all the key holders
192
00:18:36,000 --> 00:18:41,000
to actually have any security impact on this thing. So all of them need to be...
193
00:18:41,000 --> 00:18:46,000
And it's very simple because you just calculate OPRFs with each of the key holders, and then you just
194
00:18:46,000 --> 00:18:49,000
sort the values together, and that's the output of your OPRF.
195
00:18:49,000 --> 00:18:57,000
This is a distributed OPRF. It's very simple, can be easily instantiated from just any other OPRF.
196
00:18:57,000 --> 00:19:05,000
And then the most sexiest of all of them is a threshold OPRF, where you have the value key
197
00:19:05,000 --> 00:19:15,000
is shared among a bunch of shareholders, and you need T shareholders to actually operate on this key.
198
00:19:15,000 --> 00:19:19,000
And T is, of course, less than the total value of all shares that are existing.
199
00:19:19,000 --> 00:19:27,000
This is something like, show me a secret sharing, if you know that, where the key is distributed among the people.
200
00:19:27,000 --> 00:19:32,000
And indeed, you never reconstruct a key at all, but you do the operation.
201
00:19:32,000 --> 00:19:41,000
Each party operates on their share, and in the end, the client is doing the recombination
202
00:19:41,000 --> 00:19:49,000
in a way that the value key is actually never recalculated, never manifests itself in RAM
203
00:19:49,000 --> 00:19:54,000
or on disk or anywhere on the network at all. And this is a really nifty thing.
204
00:19:54,000 --> 00:20:01,000
And the only thing, if you combine it with a distributed key generation, then this is especially true.
205
00:20:01,000 --> 00:20:03,000
And it's really, really awesome.
206
00:20:03,000 --> 00:20:09,000
The only thing that you need to do for actually making this happen is this Lagrange interpolation in the exponent,
207
00:20:09,000 --> 00:20:12,000
which is something that took me quite some time to understand.
208
00:20:12,000 --> 00:20:19,000
But basically, you need to understand how Lagrange interpolation works, and then for that you need the Lagrange coefficient.
209
00:20:19,000 --> 00:20:35,000
And it's in mathematics that looks like this horrible form, but it boils down that you need to know the indexes of the shares.
210
00:20:35,000 --> 00:20:42,000
When you split your key into shares, then each share has an index, like this is the first share, second share, and so on.
211
00:20:42,000 --> 00:20:48,000
And you need to know the indexes of the shares that are used in this calculation.
212
00:20:48,000 --> 00:20:56,000
And so this ES variable is just a set of the indexes that are contributing to this calculation.
213
00:20:56,000 --> 00:21:02,000
And then you can calculate the Lagrange coefficient for each of the participants.
214
00:21:02,000 --> 00:21:07,000
And this is the Python code that implements the horrible formula above there.
215
00:21:07,000 --> 00:21:15,000
And on the right side you see this is a real world example of actually the numbers that you are working with,
216
00:21:15,000 --> 00:21:20,000
because the indexes of the shares are 0, 1, 2, 3.
217
00:21:20,000 --> 00:21:27,000
Maybe if you have a setup with five shares in total, then the highest number you have in this formula is 5,
218
00:21:27,000 --> 00:21:30,000
and the result are something like 3, 1, and -3.
219
00:21:30,000 --> 00:21:35,000
So this is not even high school math, but the formula looks really, really scary.
220
00:21:35,000 --> 00:21:39,000
But in the end, these are all public values. This is not even secrets or anything.
221
00:21:39,000 --> 00:21:46,000
You just need to know the indexes of the shares that are contributing so that you can calculate the Lagrange coefficients.
222
00:21:46,000 --> 00:21:47,000
Yes, sir?
223
00:21:47,000 --> 00:21:52,000
No, there's no trusted... The question was if the shares are trusted.
224
00:21:52,000 --> 00:21:57,000
No, the shares are like the shares that the value key is split into.
225
00:21:57,000 --> 00:22:05,000
The question is if there's a trusted person who splits this.
226
00:22:05,000 --> 00:22:09,000
You can do that, but if you use a distributed key generation, then there's no trusted leader.
227
00:22:09,000 --> 00:22:17,000
So there's no trusted... This is completely every node is...
228
00:22:17,000 --> 00:22:23,000
If you use it with a distributed key generation, there's no trusted leader. Every node is equal.
229
00:22:23,000 --> 00:22:29,000
This is how it looks if you do this. There's two ways.
230
00:22:29,000 --> 00:22:37,000
If you know in advance which shares are contributing, then Alice can actually... She knows ES.
231
00:22:37,000 --> 00:22:42,000
This is the set of the indexes. She knows that, and she can send that along.
232
00:22:42,000 --> 00:22:46,000
So as you can see, this is still the same thing as with the hash DH.
233
00:22:46,000 --> 00:22:55,000
And Alice sends over this ES set of indexes that we know in advance that are going to contribute.
234
00:22:55,000 --> 00:23:00,000
And all the server does is actually does two exponentiations here.
235
00:23:00,000 --> 00:23:05,000
First to their own key share and then to their own Lagrange coefficient,
236
00:23:05,000 --> 00:23:10,000
which the server can calculate using this formula or this Python code.
237
00:23:10,000 --> 00:23:20,000
And then that sends it back, and then all the client has to do is actually just multiply all the results that are coming back together
238
00:23:20,000 --> 00:23:28,000
and then unblind the whole thing, and then the client has exactly the same result as if the client would have done this in a non-threshold setting,
239
00:23:28,000 --> 00:23:32,000
where the value k is not split among all those people but is in one.
240
00:23:32,000 --> 00:23:34,000
Then it's exactly the same result.
241
00:23:34,000 --> 00:23:40,000
But most of the time, you don't know this in advance which servers are going to answer because some is DOS,
242
00:23:40,000 --> 00:23:45,000
some is in a safe because for offline backup purposes, or some is slow.
243
00:23:45,000 --> 00:23:50,000
So you just send your request to all of them, and then in the end you do the Lagrange interpolation.
244
00:23:50,000 --> 00:23:56,000
So in this case, actually the first two steps are completely the same as in a non-threshold setting.
245
00:23:56,000 --> 00:23:59,000
So the client is doing the same as in a non-threshold setting.
246
00:23:59,000 --> 00:24:02,000
The server doesn't even have to know this is a threshold setting.
247
00:24:02,000 --> 00:24:13,000
And then the only thing that is different is the client has to do this Lagrange interpolation in the exponent down here
248
00:24:13,000 --> 00:24:16,000
before the multiplication of all the results.
249
00:24:16,000 --> 00:24:18,000
And this is a bit more inefficient.
250
00:24:18,000 --> 00:24:21,000
This means that the client has to do a lot of computation.