RE: MUSCLE how to get the size of a memorycard?

2000-12-08 Thread Guillaume LAISNEY

Hello,

You can get the size of a memory card from the second byte of its ATR.
According to ISO 7816-3, the 3 LSB of this byte define the length of data 
units (in bits), and its 4 next bits, the number of data units as :

 = No size specified
0001 = 128 data units
0010 = 256
0011 = 512
0100 = 1024
0101 = ???
...



Example :
ATR = 92 23 10 91
23 -> 0 0100 011  ->0100 data units ,  011 bits per data unit

This card is a 1 kb memorycard...


Regards.

Guillaume.


_

Guillaume LAISNEY
REALTRONIC  - service R&D logiciel

email: [EMAIL PROTECTED]

tel:+33 (0) 2 33 50 98 00
fax:+33 (0) 2 33 50 98 49

REALTRONIC
Z.I. Conillot
50400 Granville
FRANCE



***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***



Re: MUSCLE how to get the size of a memorycard?

2000-12-08 Thread Peter Tomlinson

A short update on 7816: from the 1997 edition of 7816-3, the synchronous
(memory) card material was removed from this part of the spec, and a new
part dedicated to synchronous cards, 7816-10, was prepared and published in
December 1999. From a March 97 draft (sorry, I haven't got the fianl
version), the size coding is extended to at least 4096 data units:

0101 2048
0110 4096

It looks from the draft as if the terminal must check for the first 8 bits
of the ATR to have the value 0010 (x2H), and then the 2nd 8 bits code
for the data unit size and number of data units - but someone with the
published version of 7816-10 ought to be able to verify this.

You are still left with the risk that the card that someone puts into the
reader might not be coded like this, because some of the ISO information is
marked 'informative'.

Regards,

Peter Tomlinson
[EMAIL PROTECTED]
- Original Message -
From: "Guillaume LAISNEY" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 08, 2000 9:05 AM
Subject: RE: MUSCLE how to get the size of a memorycard?


> Hello,
>
> You can get the size of a memory card from the second byte of its ATR.
> According to ISO 7816-3, the 3 LSB of this byte define the length of data
> units (in bits), and its 4 next bits, the number of data units as :
>
>  = No size specified
> 0001 = 128 data units
> 0010 = 256
> 0011 = 512
> 0100 = 1024
> 0101 = ???
> ...
>
>
>
> Example :
> ATR = 92 23 10 91
> 23 -> 0 0100 011  ->0100 data units ,  011 bits per data unit
>
> This card is a 1 kb memorycard...
>
>
> Regards.
>
> Guillaume.
>
>
> _
>
> Guillaume LAISNEY
> REALTRONIC  - service R&D logiciel
>
> email: [EMAIL PROTECTED]
>
> tel:+33 (0) 2 33 50 98 00
> fax:+33 (0) 2 33 50 98 49
>
> REALTRONIC
> Z.I. Conillot
> 50400 Granville
> FRANCE
>
>
>
> ***
> Linux Smart Card Developers - M.U.S.C.L.E.
> (Movement for the Use of Smart Cards in a Linux Environment)
> http://www.linuxnet.com/smartcard/index.html
> ***
>

***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***



Re: MUSCLE how to get the size of a memorycard?

2000-12-08 Thread Henning Koester

Hi,

Ok thanks. But I've got a problem. I have 3 memorycards. 2 "normal" ones and
one card with a PIN authentification mechanism. Only this card returns a
ATR when I send:
unsigned char GET_ATR[] = { 0x20, 0x12, 0x01, 0x01, 0 };

What's the problem?
Thanks


On Fri, Dec 08, 2000 at 09:05:04AM -, Guillaume LAISNEY wrote:
> Hello,
> 
> You can get the size of a memory card from the second byte of its ATR.
> According to ISO 7816-3, the 3 LSB of this byte define the length of data 
> units (in bits), and its 4 next bits, the number of data units as :
> 
>  = No size specified
> 0001 = 128 data units
> 0010 = 256
> 0011 = 512
> 0100 = 1024
> 0101 = ???
> ...
> 
> 
> 
> Example :
> ATR = 92 23 10 91
> 23 -> 0 0100 011  ->0100 data units ,  011 bits per data unit
> 
> This card is a 1 kb memorycard...
> 
> 
> Regards.
> 
> Guillaume.
> 
> 

***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***



Re: MUSCLE how to get the size of a memorycard?

2000-12-08 Thread Peter Tomlinson

Do you know if your cards comply with ISO 7816? Or perhaps they use one of
the other interface protocols not recognised by ISO (e.g. I2C). Or maybe its
the other way round: your cards are 7816 compliant but the reader is not.
Memory cards are an area where you have to be sure that the card and reader
match each other, and that means you have to have the suppliers'
specifications.

Peter
- Original Message -
From: "Henning Koester" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 08, 2000 12:31 PM
Subject: Re: MUSCLE how to get the size of a memorycard?


> Hi,
>
> Ok thanks. But I've got a problem. I have 3 memorycards. 2 "normal" ones
and
> one card with a PIN authentification mechanism. Only this card returns a
> ATR when I send:
> unsigned char GET_ATR[] = { 0x20, 0x12, 0x01, 0x01, 0 };
>
> What's the problem?
> Thanks
>
>
> On Fri, Dec 08, 2000 at 09:05:04AM -, Guillaume LAISNEY wrote:
> > Hello,
> >
> > You can get the size of a memory card from the second byte of its ATR.
> > According to ISO 7816-3, the 3 LSB of this byte define the length of
data
> > units (in bits), and its 4 next bits, the number of data units as :
> >
> >  = No size specified
> > 0001 = 128 data units
> > 0010 = 256
> > 0011 = 512
> > 0100 = 1024
> > 0101 = ???
> > ...
> >
> >
> >
> > Example :
> > ATR = 92 23 10 91
> > 23 -> 0 0100 011  ->0100 data units ,  011 bits per data unit
> >
> > This card is a 1 kb memorycard...
> >
> >
> > Regards.
> >
> > Guillaume.
> >
> >
>
> ***
> Linux Smart Card Developers - M.U.S.C.L.E.
> (Movement for the Use of Smart Cards in a Linux Environment)
> http://www.linuxnet.com/smartcard/index.html
> ***
>

***
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***