Here are the currently supported systems for Hypercam. You will also find at the end of this
file informations about required settings for proper emulation support...if any are required.

+-----------+
|SOFTCAM	|
+-----------+

=====
ECM 
=====

=> SECA 1
=> SECA 2
=> VIACCESS 1
=> VIACCESS 2.x 
=> TPSCrypt
=> NAGRA 1
=> NAGRA 2
=> CRYPTOWORKS
=> IRDETO 2

=====
EMM
=====

=> SECA 1
=> SECA 2
=> VIACCESS 1
=> VIACCESS 2.x
=> TPSCrypt
=> NAGRA 1
=> NAGRA 2
=> IRDETO 2

+-----------+
|SMARTCARD	|
+-----------+

=====
ECM 
=====

=> SECA 1
=> SECA 2
=> SECA 3
=> VIACCESS 1
=> VIACCESS 2.x
=> VIACCESS 3.x
=> CRYPTOWORKS
=> CONAX
=> IRDETO 1
=> IRDETO 2
=> BETACRYPT
=> NDS
=> NAGRA 2
=> NAGRA 3

=====
EMM
=====

=> SECA 1
=> SECA 2
=> SECA 3
=> VIACCESS 1
=> VIACCESS 2.x 
=> VIACCESS 3.x 
=> CRYPTOWORKS
=> CONAX
=> IRDETO 1
=> IRDETO 2
=> BETACRYPT
=> NDS
=> NAGRA 2
=> NAGRA 3


+-----------+
|IRDETO 2	|
+-----------+

You have to setup several specific keys so that I2 emulation is okay...

=> P0 : REQUIRED : This 'key' contains as a sequence of 4 digits ids, all the valid CHID for this provider.
=> 02, 04 and 06 are OP keys...for ECM processing. They would be extracted from stream if you have AU tools okay.
=> S0 : REQUIRED FOR AU : This is the shared address for update. Only 4 first digits are used, but should be 6 digits long.
=> M0 : REQUIRED FOR AU : This is the first management key. It can be 16 bytes long or 32 bytes, if required.
=> M1 : REQUIRED FOR AU : This is the second management key. It can be 16 bytes long or 32 bytes, if required.

Depending on the provider, M0 and M1 can be 16 or 32 bytes wide...If 32 bytes are required you of course have to provide
them without [ and ] ;o)

Here is a sample, with fixed keys located in hypercam.keys file (xml) :

<system id="0x626">
	<provider id="0">
		<set>
			<key type="P" value="0002" />
			<key type="S" value="xxyyzz" />
			<key type="M" index="0" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
			<key type="M" index="1" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
		</set>
	</provider>
</system>

In SoftCam.Key file you will then find the op keys :

; 13.0 E - FREEX TV
I 0626   02  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I 0626   04  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I 0626   06  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I 0626   08  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


+-----------+
|NAGRA 1	|
+-----------+

Emulating NAGRA require you to provide some important keys and data.

First, you've got to know what type of smartcard hypercam is going to emulate, and upload
associated ROM, EEPROM and (when needed), ROM extension to the folder /var/keys/nagra/xxxxx.bin

Those files are named this way :

nagraromX.bin where X should be 2, 3, 7, 10 or 11 depending on your ROM version.
nagraromXext.bin with the same ROM number, if you have an extension.
nagraeprX_YY.bin, with X being the ROM number and YY being the first two digits of the main provider 
of the card. For example, if you emulate 5401, you have to provider nagraepr7_54.bin for a ROM 7 card
dump.

In addition to the dumps, you have to provide management keys into hypercam.keys XML file.
Providing them into SoftCam.Key file is not supported (key structure is too much complicated).

Here is an example for provider 5401. Have a look at the comments to see how emulation works...

<!-- provider 0x5401 in UK is a N1 card...so System ID is 0x1800 -->
<system id="0x1800">

	<provider id="0x5401">

		<!-- Provider 0x5401 = Index 0 = Master -->

		<!-- Here we find the MAIN key set of the emulated card. You have to provide E1 / N1 and N2...
		And the optionnal verification key V0. This key set must be index="0" / subindex="0" / type="0" -->

        <set index="0" subindex="0" type="0">
        	<key type="V" value="1122334455667788" />
			<key type="E" index="1" value="B0.............Bn" />
			<key type="N" index="1" value="B0.............Bn" />
			<key type="N" index="2" value="B0.............Bn" />
		</set>

		<!-- Depending on the type of the rom, we may have to provide a dedicated EMM RSA master key .
		EMM dedicated keys are in key sets of type 1 and no more 0. The subindex is used to tell the
		ROM number...and when required, the key set 'index' attribute should be set to appropriate
		value...if not set is used, use key set index="0"... 
		This RSA key is often found under the name N2a in some SoftCam.Key files -->

        <!-- ROM 10 master EMM N2 key -->

        <set index="0" subindex="10" type="1">
			<key type="N" index="2" value="B0.............Bn" />
		</set>

		<!-- Here is the same N2 key but for a ROM 11 emulation -->
        
		<!-- ROM 11 master EMM N2 key -->

        <set index="0" subindex="11" type="1">
			<key type="N" index="2" value="B0.............Bn" />
		</set>

		<!-- In some cases, we may have to provider ECM or EMM slave provider's dedicated keys.
		It can be the case for some ROM 11 cards, that use dedicated E1 / N1 values, with a 
		key set index. We provide these keys this way : -->

        <!-- Provider 0x5501 = Index 1 = Slave  -->

        <!-- ROM 11 slave EMM keys -->

        <set index="1" subindex="11" type="1">
        	<key type="E" index="1" value="B0.............Bn" />
            <key type="N" index="1" value="B0.............Bn" />
		</set>

		<!-- 

		Please note that NO KEY is provided with <provider="0x5501">. Hypercam know that a N1 card
		has 2 providers and it will automatically setup provider 5501 when you declare MASTER provider
		5401. Always provide all keys this way. Keyset number 0 in this case is for MASTER, and number 1
		is for FIRST SLAVE, so in our example, 5501. For a card with 4 providers, we may have index
		0 (Master) and 1,2 and 3 for slaves.

		-->

	</provider>

</system>

+-----------+
|NAGRA 2	|
+-----------+

Emulating NAGRA 2 require you to provide some important keys and data.

Let's take an example to be more clear...

For Premiere...card issuer ID is 0x0401, and channel use provider 0x0501.

So you've got to provide the following settings :

<system id="0x1801">

	<provider id="0x0401">

		<!-- index=0 => Provider 0x0401 = Master : ECM management -->

        <set index="0" subindex="0" type="0">

			<!-- ECM IDEA verification key -->
        	<key type="V" value="00112233445566778899AABBCCDDEEFF" />

			<!-- ECM RSA decryption key, 64 bytes wide -->
			<key type="R" index="0" value="B0.............Bn" />
			
			<!-- OPKEYS will usually be provided through SoftCam.Key file -->
		</set>

        <!-- index=1 => Provider 0x0501 = Slave : EMM management -->
        
        <set index="1" subindex="0" type="1">
        	
			<!-- EMM IDEA verification key -->
        	<key type="V" value="00112233445566778899AABBCCDDEEFF" />

			<!-- EMM RSA decryption key, 96 bytes wide -->
			<key type="R" index="0" value="B0.............Bn" />
			
			<!-- EMM IDEA decryption key -->
        	<key type="I" index="0" value="00112233445566778899AABBCCDDEEFF" />

		</set>

	</provider>

</system>
