All Projects → david-oswald → Jc_curve25519

david-oswald / Jc_curve25519

Licence: other
Javacard implementation of Curve25519 (prototype, work-in-progress)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Jc curve25519

noble-ed25519
Fastest JS implementation of ed25519, x25519 & ristretto255. Independently audited, high-security, 0-dependency EDDSA signatures and ECDH key agreement
Stars: ✭ 220 (+1122.22%)
Mutual labels:  elliptic-curves
secp256k1-ml
Elliptic curve library secp256k1 wrapper for Ocaml
Stars: ✭ 18 (+0%)
Mutual labels:  elliptic-curves
Kyber
Advanced crypto library for the Go language
Stars: ✭ 412 (+2188.89%)
Mutual labels:  elliptic-curves
ecurve
DiffieHellman, Elgamal, ECDSA & STS with elliptic curve in python
Stars: ✭ 19 (+5.56%)
Mutual labels:  elliptic-curves
pairing
Optimised bilinear pairings over elliptic curves
Stars: ✭ 44 (+144.44%)
Mutual labels:  elliptic-curves
zax
NaCl-based Cryptographic Relay
Stars: ✭ 62 (+244.44%)
Mutual labels:  elliptic-curves
hacl
Archived. Curve25519 support has been integrated into mirage-crypto-ec (via fiat-crypto). Hacl bindings are available from the hacl-star opam package. OCaml bindings for HACL* elliptic curves
Stars: ✭ 21 (+16.67%)
Mutual labels:  elliptic-curves
Ellipticcurvekeypair
Sign, verify, encrypt and decrypt using the Secure Enclave
Stars: ✭ 589 (+3172.22%)
Mutual labels:  elliptic-curves
schnorr-nizk
Schnorr Protocol for Non-interactive Zero-Knowledge Proofs
Stars: ✭ 67 (+272.22%)
Mutual labels:  elliptic-curves
Wickr Crypto C
An implementation of the Wickr Secure Messaging Protocol in C
Stars: ✭ 279 (+1450%)
Mutual labels:  elliptic-curves
zkp
Experimental zero-knowledge proof compiler in Rust macros
Stars: ✭ 121 (+572.22%)
Mutual labels:  elliptic-curves
ed448
A golang implementation of Ed448-Goldilocks. This is a mirror of https://bugs.otr.im/otrv4/ed448
Stars: ✭ 36 (+100%)
Mutual labels:  elliptic-curves
EllipticCurve
An elliptic curve library written in Swift 4
Stars: ✭ 18 (+0%)
Mutual labels:  elliptic-curves
cryptos
Pure Python from-scratch zero-dependency implementation of Bitcoin for educational purposes
Stars: ✭ 846 (+4600%)
Mutual labels:  elliptic-curves
Bulletproofs
Bulletproofs are short non-interactive zero-knowledge proofs that require no trusted setup
Stars: ✭ 458 (+2444.44%)
Mutual labels:  elliptic-curves
BulletproofJS
Set of JavaScript based tools and Ethereum Solidity contracts for BulletProof based range proofs and confidential transactions
Stars: ✭ 26 (+44.44%)
Mutual labels:  elliptic-curves
2D-Elliptic-Mesh-Generator
2D orthogonal elliptic mesh generator which solves the Winslow partial differential equations
Stars: ✭ 36 (+100%)
Mutual labels:  elliptic-curves
Opmsg
opmsg message encryption
Stars: ✭ 704 (+3811.11%)
Mutual labels:  elliptic-curves
Curve25519 Dalek
A pure-Rust implementation of group operations on Ristretto and Curve25519
Stars: ✭ 477 (+2550%)
Mutual labels:  elliptic-curves
tweedle
Generator and supporting evidence for security of the Tweedledum/Tweedledee pair of elliptic curves suitable for Halo
Stars: ✭ 16 (-11.11%)
Mutual labels:  elliptic-curves

jc_curve25519

Javacard implementation of Curve25519 (prototype, work-in-progress).

This code is in the public domain.

Requirements

  • Javacard 3.0.1 or higher (currently developed on J2D081)
  • JCDK 3.0.3 or higher (see below)
  • Working Java SDK / ant installation
  • For testing: Python with smartcard packages

Building

This code uses the excellent JC Ant task and the GP tool for building and installation. Compile using:

ant curve

This assumes you have a Javacard 3.0.3 SDK (JCDK) in the folder pointed to by build.xml:

<property name="JC303" value="../jc303" />

Here, we assume the JCDK is one folder up. Change as needed. JCDK packages can e.g. be found at https://github.com/martinpaljak/oracle_javacard_sdks

JC Ant and the GP tool are written by Martin Paljak (https://github.com/martinpaljak) and are available under the MIT / LGPL license (see the respective repositories for details).

Installation

Upload .cap file after compilation to card using gp:

gp --install curve25519_jc303.cap

If the applet was installed before, remove it first:

gp --uninstall curve25519_jc303.cap	

Testing

Using Python, execute jc_curve25519.py. Requires pyScard to communicate with card. A convenient way under Windows is using Anaconda (http://continuum.io/downloads). An example output could be:

== Testing against test vector == 
pkRef  = 0x6a4e9baa8ea9a4ebf41a38260d3abf0d5af73eb4dc7d8b7454a7308909f02085L
pkTest = 0x6a4e9baa8ea9a4ebf41a38260d3abf0d5af73eb4dc7d8b7454a7308909f02085L
diff = 0x0L

== Available readers:
0) SCM Microsystems Inc. SCR35xx USB Smart Card Reader 0
 Connecting to first reader ... 
 ATR: 3B F9 18 00 00 81 31 FE 45 4A 32 44 30 38 31 5F 50 56 B6
 App selected

== Testing on-card key generation
pkRef  = 0x336f019040df969295182ef7cc4873f2d406a3e878cea1c035d740bdbab673aeL
pkTest = 0x336f019040df969295182ef7cc4873f2d406a3e878cea1c035d740bdbab673aeL
diff = 0x0L

== Testing setting the private key
pkRef  = 0x6a4e9baa8ea9a4ebf41a38260d3abf0d5af73eb4dc7d8b7454a7308909f02085L
pkTest = 0x6a4e9baa8ea9a4ebf41a38260d3abf0d5af73eb4dc7d8b7454a7308909f02085L
diff = 0x0L

== Testing generating shared secret
secretRef  = 0x4217161e3c9bf076339ed147c9217ee0250f3580f43b8e72e12dcea45b9d5d4aL
secretTest = 0x4217161e3c9bf076339ed147c9217ee0250f3580f43b8e72e12dcea45b9d5d4aL
diff = 0x0L

Execution times

I measured the following execution times on a J2D081 smartcard using timeit.default_timer. These timings include the communication overhead for sending and receiving data, but not the post-processing in Python:

On-card key generation (generate 32 random bytes, perform one ECC operation): 624 ms
Set private key (perform one ECC operation): 618 ms
Generate shared secret (perform one ECC operation with pre-set private key): 122 ms

The timings are very consistent over multiple executions.

Acknowledgements

Thanks to Peter Schwabe for his helpful comments and suggestions and to Shaima Al Amri, who worked on this topic for an MSc project.

License

Public domain, see LICENSE

Useful links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].