Skip to content

Commit

Permalink
Add THD-89 repos and add to build
Browse files Browse the repository at this point in the history
  • Loading branch information
3rdIteration committed Nov 15, 2023
1 parent 80bb562 commit caf07d1
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@
[submodule "sdks"]
path = sdks
url = https://github.com/martinpaljak/oracle_javacard_sdks
[submodule "applets/satochip-thd89"]
path = applets/satochip-thd89
url = https://github.com/3rdIteration/SatochipApplet
branch = THD-89
[submodule "applets/seedkeeper-thd89"]
path = applets/seedkeeper-thd89
url = https://github.com/3rdIteration/Seedkeeper-Applet
branch = THD-89
[submodule "applets/satodime-thd89"]
path = applets/satodime-thd89
url = https://github.com/3rdIteration/Satodime-Applet
branch = THD-89
1 change: 1 addition & 0 deletions applets/satochip-thd89
Submodule satochip-thd89 added at e934d5
1 change: 1 addition & 0 deletions applets/satodime-thd89
Submodule satodime-thd89 added at a2e33d
1 change: 1 addition & 0 deletions applets/seedkeeper-thd89
Submodule seedkeeper-thd89 added at f7111e
29 changes: 25 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,46 @@

<!-- Build Satochip (Official) for Javacard 3.0.4 -->
<javacard>
<cap jckit=".\sdks\jc304_kit" aid="5361746F43686970" version="0.1" output="build/SatoChip-3.0.4.cap" sources="applets\satochip\src\org\satochip\applet">
<cap jckit=".\sdks\jc304_kit" aid="5361746F43686970" version="0.1" output="build/SatoChip-official-3.0.4.cap" sources="applets\satochip\src\org\satochip\applet">
<applet class="org.satochip.applet.CardEdge" aid="5361746F4368697000"/>
</cap>
</javacard>

<!-- Build Seedkeeper (Official) for Javacard 3.0.4 -->
<javacard>
<cap jckit=".\sdks\jc304_kit" aid="536565644b6565706572" version="0.1" output="build/SeedKeeper-3.0.4.cap" sources="applets\seedkeeper\src\org\seedkeeper\applet">
<cap jckit=".\sdks\jc304_kit" aid="536565644b6565706572" version="0.1" output="build/SeedKeeper-official-3.0.4.cap" sources="applets\seedkeeper\src\org\seedkeeper\applet">
<applet class="org.seedkeeper.applet.SeedKeeper" aid="536565644b656570657200"/>
</cap>
</javacard>

<!-- Build Satodime (Official) for Javacard 3.0.4 -->
<javacard>
<cap jckit=".\sdks\jc304_kit" aid="5361746f44696d65" version="0.1" output="build/SatoDime-3.0.4.cap" sources="applets\satodime\src\org\satodime\applet">
<cap jckit=".\sdks\jc304_kit" aid="5361746f44696d65" version="0.1" output="build/SatoDime-official-3.0.4.cap" sources="applets\satodime\src\org\satodime\applet">
<applet class="org.satodime.applet.Satodime" aid="5361746f44696d6500"/>
</cap>
</javacard>


<!-- Build Satochip (THD-89) for Javacard 3.0.4 -->
<javacard>
<cap jckit=".\sdks\jc304_kit" aid="5361746F43686970" version="0.1" output="build/SatoChip-THD89-3.0.4.cap" sources="applets\satochip-thd89\src\org\satochip\applet">
<applet class="org.satochip.applet.CardEdge" aid="5361746F4368697000"/>
</cap>
</javacard>

<!-- Build Seedkeeper (THD-89) for Javacard 3.0.4 -->
<javacard>
<cap jckit=".\sdks\jc304_kit" aid="536565644b6565706572" version="0.1" output="build/SeedKeeper-THD89-3.0.4.cap" sources="applets\seedkeeper-thd89\src\org\seedkeeper\applet">
<applet class="org.seedkeeper.applet.SeedKeeper" aid="536565644b656570657200"/>
</cap>
</javacard>

<!-- Build Satodime (THD-89) for Javacard 3.0.4 -->
<javacard>
<cap jckit=".\sdks\jc304_kit" aid="5361746f44696d65" version="0.1" output="build/SatoDime-THD89-3.0.4.cap" sources="applets\satodime-thd89\src\org\satodime\applet">
<applet class="org.satodime.applet.Satodime" aid="5361746f44696d6500"/>
</cap>
</javacard>

</target>

</project>
18 changes: 11 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following cards are readily available and tested and confirmed to work.
* J3R180 (Recommended Card) [Buy from Satochip](https://satochip.io/product/card-for-diy-project/)
* NXP JCOP3 P60 Based Javacards
* J3H145
* THD-89 Based Javacards
* THD-89 Based Javacards (These currently don't work reliably with the official builds, but this repository also includes some versions tweaked to support them)
* CodeWav NFC Sticker Tag Micro Edition
* THETAKey T101
* THETAKey T104 (CodeWav-2 NFC Card)
Expand All @@ -41,6 +41,8 @@ You can find a database of various Javacards and their supported functions here:

**If you attempt to flash the applets to an unsupported card, you will likely get an error after the CAP file has been loaded.**

Error: INSTALL [for install and make selectable] failed: 0x6444

### Where to Buy

You can source these Java Smartcards from a range of different websites depending on where in the world you live. Generally speaking, purchasing single cards is rarely cost-effective and you will often end up paying $20+ USD on shipping.
Expand Down Expand Up @@ -69,7 +71,7 @@ If you have a Github account and are logged in, you can view and download the bu

On this screen, you can also click on the `Build` job button to view a log of the build process and verify that the SHA256 sums of the applets match those that you downloaded.

### Harder Method - Building on your own PC
### Harder, but Better Method - Building on your own PC

#### Cloning this Github Repository
This repository includes resources from other Github repositories, so it is nessesary to use Git to download it recursively.
Expand Down Expand Up @@ -126,11 +128,13 @@ This repository includes a release of [GlobalPlatformPro](https://github.com/mar

**On Windows**

gp.exe --install FILENAME.cap
gp.exe --install ./build/FILENAME.cap

**On Other Operating Systems**

java -jar gp.jar --install FILENAME.cap
java -jar gp.jar --install ./build/FILENAME.cap

Applets can be uninstalled in the same way using the `--uninstall` command.

## Locking Javacards (Optional)
While it is not possible download applets (And wallet data) from an unlocked card, leaving the card unlocked makes it very easy for someone to discover what applets are installed on the card, delete these applets and potentially install other applets of their own. (Including those which could exploit yet-to-be-discovered weaknesses in the Javacard OS or Applet segregation protections) Locking cards is easy and is a good idea...
Expand All @@ -147,18 +151,18 @@ For example, to lock the cards with the key `010B0371D78377B801F2D62AFC671D95`

**On Other Operating Systems**

java --lock 010B0371D78377B801F2D62AFC671D95
java -jar gp.jar --lock 010B0371D78377B801F2D62AFC671D95

After this command has been run, further operations will require that the key is specified with the `--key` argument

For example installing an applet on a card locked with the key `010B0371D78377B801F2D62AFC671D95` would be:

**On Windows**

gp.exe --key 010B0371D78377B801F2D62AFC671D95 --install FILENAME.cap
gp.exe --key 010B0371D78377B801F2D62AFC671D95 --install ./build/FILENAME.cap

**On Other Operating Systems**

java -jar gp.jar --key 010B0371D78377B801F2D62AFC671D95 --install FILENAME.cap
java -jar gp.jar --key 010B0371D78377B801F2D62AFC671D95 --install ./build/FILENAME.cap

## Simulator

0 comments on commit caf07d1

Please sign in to comment.