https://github.com/cunicu/go-feitian-oath
A Go implementation to manage OATH-TOTP/HOTP and Challenge Response secrets on FEITIANs's tokens
https://github.com/cunicu/go-feitian-oath
feitian go golang oath smart-card
Last synced: about 2 months ago
JSON representation
A Go implementation to manage OATH-TOTP/HOTP and Challenge Response secrets on FEITIANs's tokens
- Host: GitHub
- URL: https://github.com/cunicu/go-feitian-oath
- Owner: cunicu
- License: apache-2.0
- Created: 2023-11-29T01:36:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-15T08:27:45.000Z (9 months ago)
- Last Synced: 2025-09-15T10:25:13.624Z (9 months ago)
- Topics: feitian, go, golang, oath, smart-card
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# go-feitian-oath: Template repository for Go packages in the cunicu organization
[](https://github.com/cunicu/go-feitian-oath/actions)
[](https://goreportcard.com/report/github.com/cunicu/go-feitian-oath)
[](https://app.codecov.io/gh/cunicu/go-feitian-oath/tree/main)
[](https://github.com/cunicu/go-feitian-oath/blob/main/LICENSES/Apache-2.0.txt)

[](https://pkg.go.dev/github.com/cunicu/go-feitian-oath)
The package `go-feitian-oath` implements the protocol to manage HOTP, TOTP, challenge/response and static password credentials on FEITIAN FIDO keys.
It uses PC/SC over CCID interface to communicate with the smart card.
## Features
- Calculation of
- Time-based One-time Passwords (TOTP)
- Hash-based One-time Passwords (HOTP)
- Challenge Response (HMAC)
- Static passwords
- Slot managment
- Set default
- Swap
- Credential management
- Put
- List
- Delete
- Factory reset of applet
## Tested devices
- [FEITIAN ePass FIDO NFC K9Plus](https://www.ftsafe.com/Products/FIDO/NFC)
- COS version 3301
## Limitations
The OTP applet of the FEITIAN keys has several limitations in comparison to its competition:
- It can only store 2 credentials
- Each of those two credentials can of type TOTP, HOTP, challenge/response or static password
- It only supports SHA1 and SHA256 hash algorithms
- Credentials can not be protected with a PIN code
- Initial counter values for HOTP credentials can not be set
**Note:** The FEITIAN OTP applet show similarities to [Yubico's `ykneo-oath` applet](https://github.com/Yubico/ykneo-oath) when it was still open source.
## Contact
Please have a look at the contact page: [cunicu.li/docs/contact](https://cunicu.li/docs/contact).
## License
go-feitian-oath is licensed under the [Apache 2.0](./LICENSE) license.