Questions tagged [smartcard]

A smartcard is a card with an embedded chip that may store cryptographic keys and/or perform cryptographic functions. Smartcards are often use as employee ID badges or in contactless credit/debit cards.

Smartcards used for cryptographic functions such as identity verification, signing, and decryption are usually designed so that the cards can generate their own cryptographic public/private key pairs, such that the private key cannot be removed or exported from the card. Using a smartcard to decrypt or sign a piece of data is usually protected by a PIN or passcode.

If you receive a message, whose signature can be validated using the public key, then you know that the message could only have been signed using the private key stored on the smartcard, which means that the message came from someone having physical possession of the smartcard and who knows the PIN or passcode required to use the smartcard. Having the decryption key on the card directly enforces, that without card and PIN knowledge just the encrypted message is available.

SIM cards used in mobile phones are also smart cards, proving an existing account towards network and storing phone numbers and text messages.

EMV cards (also known as "chip and pin") use smartcards to increase security and decrease fraud. The EMV standard, and its test cases, are governed by EMVCo.

Smartcards have a dedicated standard: ISO/IEC 7816 that describes what defines a smartcard from physical characteristics to cryptographic information application, including protocols and commands.

Contactless smart card (such as PayPass and payWave etc) are covered by ISO/IEC 14443; that describe the physical characteristics of the card, power and signal interfaces, transmission and collision detection, and transmission protocols.

EMV cards are also issued with "dual" interfaces that use the same chip on the card and two external interfaces.

1917 questions
5
votes
1 answer

C# PCSC-sharp Send / Receive Custom Commands with Data

I'm working on a C# Java Card (Smart Card) program, and I am trying to utilize the PCSC-sharp library on github. Here's the "short / tl;dr" version of my request: The PCSC-sharp example covers Iso7816 Case2Short. Can someone either correct my…
Blue Smoke
  • 83
  • 1
  • 5
5
votes
1 answer

MacOS and JSVC: SCARD_E_NO_SERVICE: The Smart card resource manager is not running

I got a JAR file that needs to run as a daemon in MacOS Sierra and I decided to use Apache Commons Daemon and JSVC for that purpose. I am aware that maybe JSVC is not really needed for this purpose (it seems only allows to open ports in a low range)…
Miguel Febres
  • 2,153
  • 2
  • 21
  • 31
5
votes
1 answer

SCardEstablishContext memory leak

We suddenly have problems with the smart card api on some windows installations. There seem to be a memory leak while calling the SCardEstablishContext function. The problem can be reproduced in a console application with the code sample available…
5
votes
1 answer

Does `Signature.init()` rewrite persistent memory?

A few quotes from Java Card API 2.2.1: Signature class description: A tear or card reset event resets an initialized Signature object to the state it was in when previously initialized via a call to init(). For algorithms which support keys…
vojta
  • 5,591
  • 2
  • 24
  • 64
5
votes
1 answer

DESFire write data command fails with 917E (length error)

I am facing a very strange problem with MIFARE DESFire. When I write small amounts of data (e.g. 11 bytes), the write operation succeeds. However, when I try to write e.g. 50 byte, the response is 917E, which means there is some length issue in…
jiten
  • 5,128
  • 4
  • 44
  • 73
5
votes
1 answer

How to read certificate from smart card via python?

I have a Smart Card (actually USB Token) with some certificate and keys written on it. Now I need to retrieve this certificate using python on Windows. How can it be achieved? I had a look on pyscard package but it seems too low-level and probably…
fbjorn
  • 722
  • 12
  • 27
5
votes
0 answers

How to get the PSE of the card to read the RID or AIP or card number

I have a smart card as in the image below. The card is in the card reader which is sticked at the server. It used to get the user authenticated before he can download the data. I am trying to get the card number or seriel number or RID of the smart…
Mr Asker
  • 2,300
  • 11
  • 31
  • 56
5
votes
1 answer

GPG key signing party w. detached master key and sub-keys on yubikey

My current setup is a as follows: sec# rsa4096/E97E8047 2016-07-18 [C] uid [ultimate] Jonas Finnemann Jensen uid [ultimate] Jonas Finnemann Jensen uid [ultimate] Jonas Finnemann…
jonasfj
  • 2,349
  • 2
  • 24
  • 22
5
votes
1 answer

Access an applet directly without AID selection

Usually, when you power up a JavaCard smartcard and want to communicate with an applet, you must select the applet using its AID first. Is there any way to have a "default applet" that is selected when the card is powered up? What I really want to…
jim
  • 8,670
  • 15
  • 78
  • 149
5
votes
3 answers

C#: Error while decoding OAEP padding weird issue

I'm currently working on a class that encrypts large amounts of text with a randomly generated encryption key encrypted by a X509 certificate from a smart card, using a RSACryptoServiceProvider to perform the master key encryption and decryption…
CitadelCore
  • 53
  • 1
  • 6
5
votes
0 answers

Verify authenticity of Java Card applet codebase without trusting the applet itself

We are developing a JavaCard-based security sensitive application. Our goal is to allow client code communicating with a GlobaPlatform 2.2+ based JavaCard applet to convince itself that it's actually talking to a specific (and verifiable) version of…
5
votes
0 answers

Are there any Android phones which support extended APDUs?

I am developing an Android app which has function to read data from a smart card. By default, NFC Controllers support APDU command with maximum transceive length is 261 bytes in single command. Because of large data need to be read on the card, the…
neo
  • 618
  • 1
  • 10
  • 29
5
votes
2 answers

What's the difference between DESFire and DESFire EV1 cards?

I have a contactless card and I know it is a MIFARE card. I have no document and no authentication key. After a reset, I received the following ATS: myubuntu@lol-MS-7693:~$ nfc-list nfc-list uses libnfc 1.7.1 NFC device: ACS / ACR122U PICC…
Brad
  • 51
  • 1
  • 2
5
votes
1 answer

Unable to sign with Smartcard through Java app after my machine has has slept: getting a PKCS11Exception: CKR_GENERAL_ERROR

I have an application that performs digital signatures with a smartcard. If my system sleeps and later wakes (both windows and mac), my invocations to signature.sign start blowing up with a sun.security.pkcs11.wrapper.PKCS11Exception:…
Pedro Rolo
  • 28,273
  • 12
  • 60
  • 94
5
votes
0 answers

KERB_CERTIFICATE_LOGON and custom KSP

I'm implementing an OTP solution based on the Microsoft's whitepaper "Strong Authentication with One-Time Passwords in Windows 7 and Windows Server 2008 R2". The summary of the relevant part of that whitepaper is to essentially fake presence of a…