Giter VIP home page Giter VIP logo

Comments (8)

martinpaljak avatar martinpaljak commented on June 11, 2024

What about extending the commandline -key option with opts:key:kcv and adding an optional kcv parameter to key class? I expect key validation to happen before invoking GPPro commands or API, normally.

from globalplatformpro.

dancvrcek avatar dancvrcek commented on June 11, 2024

yes, validation should be upon entry. An opts --kcv sounds good. It would be great to enforce use of this when the "production" switch (#36) is used.

from globalplatformpro.

martinpaljak avatar martinpaljak commented on June 11, 2024

Just to clarify: for a KCV you mean the same algorithm that is used for PUT KEY? KCV could mean anything and could be proprietary, unless referencing some known algorithm in a public specification (same for other key derivation methods, and there's plenty of proprietary stuff in smart card field) I'm thinking of re-writing the whole key argument handling but don't yet have a great idea how. Eventually it would be nice if the key could be provided with a kcv in one argument (like currently des: and aes: prefixes work). But also the relax hex parsing of the key options is something I'd like to keep (easy copy-paste from e-mails, documentation etc), so some heuristics need to be done. Will do that on my next spring on GP.

from globalplatformpro.

martinpaljak avatar martinpaljak commented on June 11, 2024

But please clarify the kcv algorithm or provide a reference implementation of some other link. Otherwise I assume PUT KEY semantics ?

from globalplatformpro.

dancvrcek avatar dancvrcek commented on June 11, 2024

yes, put key - there is an industry standard that basically says the KCV is the first 24 bits (in hex format) of zero string encrypted with a given key.
"- The KCV is the "Key Check Value" for the key, calculated by assuming the key/components are 3DES keys, and encrypting a string of binary zeroes. The KCV is the first six hex digits of the resulting ciphertext."

It is mainly used for DES/3DES but I've seen applications for AES keys as well. Here's one online calculator working for DES/3DES only: http://extranet.cryptomathic.com/keyshares/index

from globalplatformpro.

martinpaljak avatar martinpaljak commented on June 11, 2024

So my idea would be to drop the current -mac/-enc/-kek command line options (but still allow to specify different keys from the API, if they are not derived from a single derived card key) for a single -key and a -kcv.

from globalplatformpro.

martinpaljak avatar martinpaljak commented on June 11, 2024

Just to add - the kcv method currently works for 3des as well as aes

from globalplatformpro.

dancvrcek avatar dancvrcek commented on June 11, 2024

works, cool! I like this. Just one comment about toString(), I will file it as a new request.

from globalplatformpro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.