JavaCard - a pure software implementation of ECC over GF (2 ^ n)

I have smart cards from NXP that support ECC over GF (p) and do not support ECC over GF (2 ^ n).

In my project, I need to use this special type of smart card (thousands of copies are already in use). However, I need to add confirmation of the EC signature over sect193r1, which is a curve over GF (2 ^ n).

Performance is not a problem for me. This may take some time. Signature verification does not include any private keys; therefore, security and key management are not problems either. Unfortunately, I have to verify the signature inside my smart card, and not on a device equipped with a smart card reader.

Is there any solution? Is there any existing source code for a pure JavaCard program for implementing EC cryptography over GF (2 ^ n)?

+7
security cryptography smartcard javacard
source share
2 answers

Smart cards capable of performing asymmetric cryptography always do this using a coprocessor (which usually contains the Montgomery multiplier). Most smart cards (such as the original NXP SmartMX processors) still work using an 8-bit or 16-bit processor. These CPUs are not designed to handle large numbers. Unfortunately, the Java Card does not provide direct support for multiplier calls — if at all. Most cards (for example, again SmartMX) also do not support 32-bit (Java int ) operations.

So, if you want to perform such calculations, you will have to program it yourself using signed 8-bit and signed 16-bit primitives. This will require a lot of work and will be very slow. Add to this the overhead required to process Java bytecode, and you will have an amazing amount of slowness.

+3
source share

Just update additional information in case someone is still looking for a solution.

OpenCryptoJC lib does provide BigNumbers, EC primitive operations, etc. Thus, you should be able to load your own curve and its parameters.

However, if this curve is not supported by the map, you use lib to perform operations on the curve yourself. This is not trivial though ...

Alternatively, if there is any comparison between the GF (2 ^ n) curve that you want to use and the other GF (p), you can try all the operations in GF (p) and they will display the results back to GF (2 ^ n). This might be easier to do if we assume that such a mapping.

Disclaimer: I am one of the authors of lib . :)

+1
source share

All Articles