RFID Guardian Software:Library:Generic library modules:Crypto
From RFID Guardian
RFID Guardian Software / Library / Generic library modules / Crypto
Crypto
The crypto module contains crypto algorithms that are not part of SSL . The current crypto algorithms are a null cipher and crapto1 , an implementation of MiFare Classic's crypto1 published anonymously on the web. This module also contains code to read keys (public, private, or symmetric), both by invoking SSL primivites and for the crypto implementations in this module.
The crypto library has an API that aims at supporting arbitrary crypto operations for RFID. It can sets keys, encrypt or decrypt bytes and 4-byte words, and perform authentication. There is only one authentication call, but it takes a parameter that indicates the phase of the authentication. E.g. for crypto1, there are stages tag nonce , reader respond where a reader is fed the tag nonce and responds with a reader nonce and a response to the tag nonce, tag respond that is fed the reader response and creates the tag's acknowledgement, and reader accept where the reader is fed the tag's acknowledgement. Each crypto algorithm implementation, e.g. in the [Spoofer spoofer ]for the tag side or in the on-board reader , must invoke the appropriate stages with the incoming message, and send the calculated responses off to the partner. The messages are passed in the form of varargs arguments to the authentication function. The crypto implementation must carefully document the arguments for each stage of the authentication.
| API | include/crypto/mrg_crypto.h , include/crypto/mrg_crypto_crypto1.h |
| Source | [ src/crypto/common/ ], [ src/crypto/key/ ], [ src/crypto/cipher/null ], [ src/crypto/cipher/mifare/crapto-v2.3/ ] |


