jBorZoi Manual (Preliminary Draft)
Dragongate Technologies Ltd.
August 12, 2003
Contents
1 Introduction 1
2 Finite Fields, Points and Elliptic Curves 2
2.1 F2m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 ECPointF2m . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.3 ECCurveF2m . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3 EC Domain Parameters 3
3.1 Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 User Defined Curves . . . . . . . . . . . . . . . . . . . . . . . 5
4 EC Keys 6
4.1 EC Private Keys . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.1 Constructors . . . . . . . . . . . . . . . . . . . . . . . 6
4.1.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 EC Public Keys . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2.1 Constructors . . . . . . . . . . . . . . . . . . . . . . . 6
4.2.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5 ECKAS-DH1 (Diffie-Hellman Key Agreement) 8
5.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6 ECDSA (the Elliptic Curve Digital Signature Algorithm) 10
6.1 Example (generating a signature for a string M with private
key sk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.2 Example (verifying a signature for a string M with public key
pk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
7 ECIES (the Elliptic Curve Integrated Encryption Scheme) 12
7.1 Example (encryption) . . . . . . . . . . . . . . . . . . . . . . 12
7.2 Example (decryption) . . . . . . . . . . . . . . . . . . . . . . 12
i
CONTENTS ii
8 AES, KDF2 and MAC1 14
9 DER Encoding 15
9.1 Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
9.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9.3 Example (Decoding a DER encoded ECDSA signature) . . . 16
Chapter 1
Introduction
jBorZoi is a Java Elliptic Curve Cryptography Library which implements
the following algorithms using elliptic curves defined over finite fields of
characteristic 2 (F
2
m
).
• The Elliptic Curve Diffie-Hellman Key Agreement Scheme as specified
in ANSI X9.63 and IEEE P1363.
• The Elliptic Curve Digital Signature Algorithm (ECDSA) as specified
in ANSI X9.62, FIPS 186-2 and IEEE P1363.
• Elliptic Curve Integrated Encryption Scheme (ECIES) as specified in
ANSI X9.63 and the IEEE P1363a Draft.
The AES symmetric encryption scheme (NIST FIPS-197), KDF2 key deriva-
tion function (P1363a), HMAC message authentication code (P1363) and
DER support are also supported.
The jBorZoi classes are contained in the com.dragongate_technologies.borZoi
package.
1
Chapter 2
Finite Fields, Points and
Elliptic Curve s
2.1 F2m
This is a multi-precision binary finite field class (F
2
m
) that represents finite
field elements in a polynomial basis of the form: b
m−1
x
m−1
+ b
m−2
x
m−2
+
· · · + b
0
, where are all operations are modulo an irreducible polynomial
a
m
x
m
+ a
m−1
x
m−1
+ · · · + a
0
2.2 ECPointF2m
This is an elliptic curve point class representing a point on the curve as two
binary finite field (F
2
m
) eleme nts x and y.
2.3 ECCurveF2m
This class represents the elliptic curve E(F
2
m
) : y
2
+ xy = x
3
+ ax
2
+ b.
2