Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
github.com/johnnyb/nfc-sun-decoder
A Decoder for NXP 424 DNA SUN (Secure Unique) messages
This library makes decoding 424 DNA SUN messages easier.
While the 424 DNA chip supports having a wide variety of data on-chip, the SUN messages are often best-used for only generating the PICCData and ignoring the rest of the URL. This allows the rest of the metadata to reside on the server. Therefore, many convenience functions are written with this in mind.
To set up your DNA chip to only MAC the PICC data, set SDMMACInputOffset equal to SDMMacOffset.
This will cause it to MAC a zero-length string.
Since the generated MAC session key includes the UID and the read counter, this validates these data fields.
This library contains a few basic concepts:
The general process is this:
All of these can be combined for PICCData-only messages using Keyset#DecodeEncryptedMetaStringWithAuthenticator. This returns the PICCData as a Meta, as well as a boolean telling you whether or not it successfully authenticated.
package main
import (
"encoding/hex"
"github.com/johnnyb/nfc-sun-decoder/decoder"
)
func main() {
// Setup keys k0 and k1
keyset := Keyset{
Mode: AES,
Keys: []Key{k0, k1},
FileReadKey: 0, // use k0
MetaReadKey: 0, // use k0
AuthenticationKey: 1, // use k1
}
// metaString is the meta string to decrypt
// authCode is the MAC code
meta, validated := keyset.DecodeEncryptedMetaStringWithAuthenticator(metaString, authCode)
// Print results
fmt.Printf("Chip UID: %s, Read Counter: %d, Validated: %t\n", meta.UidHex(), meta.ReadCounter, validated)
}
If you are using this from another language, a command-line application is also provided, sundecoder
. It is used like this:
./sundecoder -meta-read-key e6cbb56d350c25eda052b27f81b1c884 -mac-key 07f23a4c407485ea3122ff242f763e77 -mac-key-application 3042f562696b65646e61 -picc-data CBF5374BC4874E7AE53961E6533DDC5F -mac-code C4B7E3310EFC2FA3
The output will look like this:
ChipUID: 0421272aaa6180
ReadCounter: 2
Validated: true
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.