mirror of https://github.com/captn3m0/epicqr.git
Nemo b23a084ee5 | ||
---|---|---|
src/eci | ||
.gitignore | ||
LICENSE | ||
README.md | ||
build.hxml | ||
extraParams.hxml | ||
haxelib.json | ||
release.sh |
README.md
EPIC QR Decoder
Haxe library to decode a QR code on a modern EPIC Card.
TODO
- Tests.
- Publish 1.0.
- Publish releases in other languages.
Usage
import eci.EpicQR;
class Main{
static function Main(){
var result = decrypt("Kk0pDEzxYcusltFhJmqL/LLzJtXYHH/a1rJfkK2GjzA1x5jrzaeT1ULEF38L7/lIQ8w3c+H4ePeuVs2HuMYDUg==");
trace(result.epic);
trace(result.id);
}
}
Specification
QR Generation
- Generate the input as
{"epic_no":"[[EPIC_NO]]","unique_generated_id":ID}
. Note that this is not parsed as JSON, so the string needs to be exactly 51 characters long. The EPIC itself uses LUHN algorithm in the numeric part (11th digit is a checksum of the 4-10th character). Sample: NCS1234566 (LUHN(123456) = 6) - Encrypt the input using AES.CBC/PKCS5, with a static KEY and IV (See
src/EpicQR.hx
for values). - Encode the output as base64. 4 .Generate a QR code with low error correction level.
QR Decoding
- Scan the QR Code
- Decode using base64.
- Decrypt using AES/CBC/PKCS5, with a static KEY and IV (See
src/EpicQR.hx
for values). - Parse as JSON
- Extract
epic_no
andunique_generated_id
keys inside the JSON object.
LICENSE
Licensed under MIT. See LICENCE
file for more details.