Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dufkan/JCEd25519
JavaCard implementation of Ed25519 signature algorithm for smartcards that do not support EdDSA algorithm introduced in JavaCard API version 3.1.
https://github.com/dufkan/JCEd25519
cryptography ed25519 javacard
Last synced: 18 days ago
JSON representation
JavaCard implementation of Ed25519 signature algorithm for smartcards that do not support EdDSA algorithm introduced in JavaCard API version 3.1.
- Host: GitHub
- URL: https://github.com/dufkan/JCEd25519
- Owner: dufkan
- License: mit
- Created: 2021-07-03T19:52:17.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-21T19:05:57.000Z (9 months ago)
- Last Synced: 2024-08-01T01:28:52.231Z (4 months ago)
- Topics: cryptography, ed25519, javacard
- Language: Java
- Homepage:
- Size: 624 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-smart-card - JCEd25519
README
# JCEd25519
JCEd25519 is a JavaCard implementation of Ed25519 signature algorithm for smartcards that do not support [Named Elliptic Curves](https://blogs.oracle.com/java/post/java-card-31-cryptographic-extensions) and the [EdDSA signature algorithm](https://docs.oracle.com/en/java/javacard/3.1/jc_api_srvc/api_classic/javacard/security/Signature.html#SIG_CIPHER_EDDSA) introduced in JavaCard API version 3.1.
The implementation uses (modified) [JCMathLib library](https://github.com/OpenCryptoProject/JCMathLib) to perform necessary operations with elliptic curve points and modular arithmetic. In case SHA512 is not supported by a JavaCard, its [software re-implementation](https://www.fi.muni.cz/~xsvenda/jcalgs.html) is used.
## :warning: WARNING :warning:
This implementation is only suited for proof-of-concept purposes and **NOT for production use**. The implementation relies on the [JCMathLib library](https://github.com/OpenCryptoProject/JCMathLib), that provides the underlying low-level operations, but not in constant time. An attacker observing signing time with sufficient precision may be able to use this information to **extract the private key**.
## Usage
- Clone this repository with submodules
```bash
git clone --recursive https://github.com/dufkan/JCEd25519
```
- Configure your card type in `JCEd25519.java` file (currently are supported only [SIMULATOR](https://github.com/licel/jcardsim), J3R180, J2E145G)- Build the applet
```bash
./gradlew buildJavaCard --info --rerun-tasks
```- Send initialize APDU `00DF000000` to the card. For example, using GlobalPlatform Pro
```bash
gp --apdu 00A404000C6A6365643235353139617070 --apdu 00DF000000 -d
```## Details
The optimizations in the implementation require the nonce to be generated randomly to be secure; otherwise, the implementation could be made to reuse nonce for signing of a different challenge. This is a minor deviation from Ed25519 specification, but it cannot be externally observed, unless multiple signatures of the same data are issued.
## Supported Cards
The implementation was tested on NXP J3R200, NXP J3H145, NXP J2E145G, and Infineon Secora ID S.