[back] [prev] [next] [index] [root]
EccEncrypt
Encrypt a message (point) using the ElGamal public key cryptosystem
and a subgroup of the group of an elliptic curve.
Syntax:
M := EccEncrypt(K,E,B,aB,k,P);
finite field |
K |
|
list |
E |
|
list |
B |
|
list |
aB |
|
integer |
k |
|
list |
P |
|
list |
M |
|
See also: EccPointsAdd, EccIntPointMult, EccPointIsOnCurve, EccDecrypt, FF
Description:
Let E be an elliptic curve over a finite field K, let B be a
basepoint of a subgroup
of the group of E. Bob chooses an integer a, as his secret key.
He publishes the public key a_B:=acdot B. Before sending a
message to Bob
Alice picks a random integer k, then she sends him the point pair
[kcdot B,P+kcdot a_B].
The elliptic curve E is
either given by a list of two or five elements of K or integers. If
the equation of E is y^2=x^3+a_4 x+a_6 the curve is represented
by [a_4,a_6], if the equation of E is
y^2+a_1 xy+a_3y=x^3+a_2x^2+a_4 x+a_6 then the representation is
[a_1,a_2,a_3,a_4,a_6]. Points on the curve are given by a pair of
elements of K or integers; the point at infinity is represented by
the empty list [\;].
Example:
kash> K := FF(11);
Finite field of size 11
kash> E := [0,0,0,1,6];
[ 0, 0, 0, 1, 6 ]
kash> B := [2,7];
[ 2, 7 ]
kash> a := 8;
8
kash> aB := EccIntPointMult(K,E,a,B);
[ 3, 5 ]
kash> k := 7;
7
kash> M := EccEncrypt(K,E,B,aB,k,[3,6]);
[ [ 7, 2 ], [ 10, 9 ] ]
kash> EccDecrypt(K,E,a,M);
[ 3, 6 ]
kash> k := 5;
5
kash> M := EccEncrypt(K,E,B,aB,k,[3,6]);
[ [ 3, 6 ], [ 7, 9 ] ]
kash> EccDecrypt(K,E,a,M);
> [ 3, 6 ]
<- back[back] [prev] [next] [index] [root]