
Elliptic curves and cryptosystems 325
Now Trent can c ompute Alice and Bob’s secret keys S
A
and S
B
:
sage: QA = H1("alice@email.org"); QA
(29 : 22 : 1)
sage: QB = H1("bob@postbox.com"); QB
(17 : 5 : 1)
sage: SA = s*QA; SA
(23 : 24 : 1)
sage: SB = s*QB; SB
(1 : 28 : 1)
Let the message be m = 25. Here’s how Alice encrypts it (no te that XOR is
implemented in Sage with a double caret):
sage: u = e(QB,Q); u
X^2
sage: t = randint(1,p); t
19
sage: C1 = t*P; C1
(5 : 5 : 1)
sage: C2 = m^^H2(u^t); C2
13
So the ciphertext is the pair
(C
1
, C
2
) = ((5 : 5 : 1), 13).
Bob can decrypt this in one step, using
m = C
2
⊕ H
2
(e(S
B
, C
1
)).
In Sage:
sage: C2^^H2(e(SB,C1))
25
For s hort signatures, ...