{"id":211,"date":"2021-01-27T11:17:01","date_gmt":"2021-01-27T09:17:01","guid":{"rendered":"http:\/\/kivijakola.fi\/projektit\/?p=211"},"modified":"2026-03-14T10:32:24","modified_gmt":"2026-03-14T08:32:24","slug":"hitag-open-source-tool","status":"publish","type":"post","link":"https:\/\/kivijakola.fi\/projektit\/2021\/01\/27\/hitag-open-source-tool\/","title":{"rendered":"Hitag2 and AES Open Source Key Programmer"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Hardware<\/strong><\/h2>\n\n\n\n<p>It is needed some 125kHz RFID reader to be able to communicate with Hitag key tags. In this project we use old Renault car card reader that is fairly well (cheap) available in scrapyards and uses PCF7991 base station IC that has also well documented datasheet available.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"800\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/card_reader.jpg\" alt=\"\" class=\"wp-image-212\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/card_reader.jpg 450w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/card_reader-169x300.jpg 169w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><figcaption class=\"wp-element-caption\">Renault card reader connection to Arduino Mega 2560<br><br><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"539\" height=\"451\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/pins.png\" alt=\"\" class=\"wp-image-224\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/pins.png 539w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/pins-300x251.png 300w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><figcaption class=\"wp-element-caption\">IO pin connection to PCF7991. Arduino pins defined in source code. As default they are:<br>din_pin = 21;<br>dout_pin = 7;<br>SCK_pin = 6;<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"612\" height=\"526\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/connector.jpg\" alt=\"\" class=\"wp-image-236\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/connector.jpg 612w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/connector-300x258.jpg 300w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><figcaption class=\"wp-element-caption\">Power connected from Arduino board directly to card reader pins<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"870\" height=\"525\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/pcf-wires.jpg\" alt=\"\" class=\"wp-image-237\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/pcf-wires.jpg 870w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/pcf-wires-300x181.jpg 300w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/pcf-wires-768x463.jpg 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Data pins are soldered directly to PCF7991 pins as connector pins has input and output multiplexed and using 12V levels. Maybe possible to use pins with some small hw modification. Not investigated yet.<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/hitag-2.ino\">hitag.ino(Update 18.02.2021\/2 Phase compensation calculation fixed)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/hitag-2.ino\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/Hitager-2.ino\">hitag.ino(Update 25.02.2021\/2)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/Hitager-2.ino\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/hitager.ino\">hitag.ino(Update 03.03.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/hitager.ino\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/Hitager-4.ino\">Hihitag.ino(Update 10.03.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/Hitager-4.ino\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/hitager.ino\">hitag.ino (support for VVDI SuperChip 13.6.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/hitager.ino\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<p>Source codes available at GitHub: <a href=\"https:\/\/github.com\/kivijakola\/hitager\/tree\/main\/Arduino\">https:\/\/github.com\/kivijakola\/hitager\/tree\/main\/Arduino<\/a><\/p>\n\n\n\n<p>Now also tested to be compatible with<strong> Arduino Nano!<\/strong> Use for example following pin settings:<br><em>const int SCK_pin = 6;<br>const int dout_pin = 7;<br>const int din_pin = 2;<\/em><br>No other changes required. <em>din_pin<\/em> must have external interrupt feature on it! Arduino Mega2560 is also compatible with <em>din_pin = 2<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"628\" height=\"342\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/arduino_nano.jpg\" alt=\"\" class=\"wp-image-365\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/arduino_nano.jpg 628w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/arduino_nano-300x163.jpg 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/PCF7991.pdf\">PCF7991 Basestation IC datasheet<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/PCF7991.pdf\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/PCF7936AS_NXP.pdf\">PCF7936AS_NXP Hitag2 tag datasheet<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/PCF7936AS_NXP.pdf\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>New Tag Reader HW version<\/strong><\/h2>\n\n\n\n<p>I decided to ordered cheap Chinese RFID adapter for IPROG (~12USD) from Aliexpress: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.aliexpress.com\/af\/-RFID-adapter-for-IPROG.html\" target=\"_blank\">https:\/\/www.aliexpress.com\/af\/-RFID-adapter-for-IPROG.html<\/a> Don&#8217;t buy full set! Only the adapter! This board has direct interface to PCF7991 via connector. There is also TMS3705 IC on board that may be used for programming tags using FSK modulation. (PCF7991 handles ASK modulation)<\/p>\n\n\n\n<p>This adapter needs little bit modification. There is no oscillator on the board. There is oscillator pin input but Arduino doesn&#8217;t have ability to feed it. So we need to add 4MHz one between PCF7991 pins 6 and 7. Also add 22pF caps between pins and GND. Also remove marked resistor that it is not causing interference to oscillator.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"479\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/modification-1024x479.jpg\" alt=\"\" class=\"wp-image-344\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/modification-1024x479.jpg 1024w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/modification-300x140.jpg 300w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/modification-768x359.jpg 768w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/modification.jpg 1167w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>Then there is simpe task left to connect adapter to Arduino. Three data pins, GND and +5V<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"670\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/arduino_connection.jpg\" alt=\"\" class=\"wp-image-345\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/arduino_connection.jpg 745w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/arduino_connection-300x270.jpg 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/figure>\n\n\n\n<p><strong>Tip\/further idea:<\/strong> Someone to design Arduino shield that has oscillator and pin routings for interfacing IPROG reader. Or even full Arduino shield with oscillator(s), PCF7991, TMS3705, switching relay, antenna etc!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Hitag2 Key Programmer<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"653\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-1.png\" alt=\"\" class=\"wp-image-437\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-1.png 699w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-1-300x280.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n\n\n\n<p>New Set ISK feature (set key easily to factory state). <\/p>\n\n\n\n<p>AESHitager app now supports also Hitag2 functionality and development is continued there. Please download at bottom of the page!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Hitag2+EE<\/strong><\/h2>\n\n\n\n<p>Command set:<br>Enter XMA state: 00111<\/p>\n\n\n\n<p>INC_BLOCK_POINTER: 00100 + inv<br>DEC_BLOCK_POINTER: 00101 + inv<br>READ_PAGE(0-7): 11XXX + inv<br>WRITE_PAGE(0-7): 10XXX + inv<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"656\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-17.png\" alt=\"\" class=\"wp-image-398\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-17.png 687w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-17-300x286.png 300w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/figure>\n\n\n\n<p>Now included to main release (scroll down)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><strong>Hitag AES Key Programmer<\/strong><\/strong> (pre-coder)<\/h2>\n\n\n\n<p>Cars after 2015 are  more common using AES enabled keys. These cards may also need some pre-coding before they can be actually coded to car. <\/p>\n\n\n\n<p>New cards can be access using XMA that is extension for Hitag2. AES cards have however little bit modified command set compared to Hitag2 XMA. Interface information was not public availble anywhere on Internet. Command set was however quite easy to find out using little bit try and error. There wasn&#8217;t even need to capture commands from any existing programmer communication. Just give commands to tag using Arduino serial port and see what card respons.<\/p>\n\n\n\n<p>In this project we don&#8217;t consider encrypted authentication of keys. There wouldn&#8217;t even be much benefit of it because even if it could be possible to read memory segment encrypted there is propably lock bits set that can&#8217;t be cleared. And if not segment can be configured to plain and accessed without encryption.<\/p>\n\n\n\n<p>If used key is wanted to use again, there always possibility to clear PCF79xx chip completely and reprogram it using specific in-circuit programmer like VVDI PROG: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.xhorsetool.com\/wholesale\/vvdi-prog-programmer.html\" target=\"_blank\">https:\/\/www.xhorsetool.com\/wholesale\/vvdi-prog-programmer.html<\/a> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"658\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-1-1024x658.png\" alt=\"\" class=\"wp-image-250\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-1-1024x658.png 1024w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-1-300x193.png 300w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-1-768x493.png 768w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-1.png 1132w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">AES card state diagram<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Command set for hitag AES<\/p>\n\n\n\n<p><strong>XMA Access State<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"836\" height=\"464\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-2.png\" alt=\"\" class=\"wp-image-253\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-2.png 836w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-2-300x167.png 300w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-2-768x426.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/figure>\n\n\n\n<p>Enter XMA state: i0540 (01000)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>READ_PAGE bit format: 11XXX + inv<br>READ_PAGE0: i0aC1C0<br>READ_PAGE1: i0aC980<br>READ_PAGE2: i0ad140<br>READ_PAGE3: i0ad900<br>READ_PAGE4: i0ae0c0<br>READ_PAGE5: i0ae880<br>READ_PAGE6: i0af040<br>READ_PAGE7: i0af800<\/p>\n\n\n\n<p>WRITE_PAGE bit format: 10XXX + inv<br>WRITE_PAGE0 i0a83c0<br>WRITE_PAGE1 i0a8B80<br>WRITE_PAGE2 i0a9340<br>WRITE_PAGE3 i0a9b00<br>WRITE_PAGE4 i0aa2c0<br>WRITE_PAGE5 i0aaa80<br>WRITE_PAGE6 i0ab240<br>WRITE_PAGE7 i0aba00<\/p>\n\n\n\n<p>After WRITE_PAGEX command tag returs given command or nothing if page not writable. After that actual data can be written with command i20XXXXXXXX. Tag does not respond anything for that. And data is there!<\/p>\n\n\n\n<p>SELECT_SEGMENT bit format: 00XXX + inv<br>SELECT_SEGMENT0: i0a07c0<br>SELECT_SEGMENT1: i0a0f80<br>SELECT_SEGMENT2: i0a1740<br>SELECT_SEGMENT3: i0a1f00<br>SELECT_SEGMENT4: i0a26c0<br>SELECT_SEGMENT5: i0a2e80<br>SELECT_SEGMENT6: i0a3640<br>SELECT_SEGMENT7: i0a3e00<\/p>\n\n\n\n<p>SELECT_BLOCK bit format: 01XXX + inv<br>SELECT_BLOCK0: i0a45c0<br>SELECT_BLOCK1: i0a4d80<br>SELECT_BLOCK2: i0a5540<br>SELECT_BLOCK3: i0a5d00<br>SELECT_BLOCK4: i0a64c0<br>SELECT_BLOCK5: i0a6c80<br>SELECT_BLOCK6: i0a7440<br>SELECT_BLOCK7: i0a7c00<\/p>\n\n\n\n<p><strong>XMA Config State<\/strong><\/p>\n\n\n\n<p>Enter XMA config  state: i05e8 (11101)<\/p>\n\n\n\n<p>READ_CONFIG bit format: 01XXX + inv<br>READ_CONFIG0: i0a45c0<br>READ_CONFIG1: i0a4d80<br>READ_CONFIG2: i0a5540<br>READ_CONFIG3: i0a5d00<br>READ_CONFIG4: i0a64c0<br>READ_CONFIG5: i0a6c80<br>READ_CONFIG6: i0a7440<br>READ_CONFIG7: i0a7c00<\/p>\n\n\n\n<p>replies are in following format:<br>0381<br>8781<br>8381<br>0381<br>0381<br>8388<br>8381<br>8381<\/p>\n\n\n\n<p>Whrere digits:<br>1: lock bit for mode<br>2: mode 0=denied 3=plain 7=crypt<br>3: lock bit for segment size<br>4: segment size (blocks)<\/p>\n\n\n\n<p>WRITE_CONFIG_MSB bit format: 10XXX + inv<br>WRITE_CONFIG_MSB0 i0a83c0<br>WRITE_CONFIG_MSB1 i0a8B80<br>WRITE_CONFIG_MSB2 i0a9340<br>WRITE_CONFIG_MSB3 i0a9b00<br>WRITE_CONFIG_MSB4 i0aa2c0<br>WRITE_CONFIG_MSB5 i0aaa80<br>WRITE_CONFIG_MSB6 i0ab240<br>WRITE_CONFIG_MSB7 i0aba00<\/p>\n\n\n\n<p>WRITE_CONFIG_LSB bit format: 11XXX + inv<br>WRITE_CONFIG_LSB0: i0aC1C0<br>WRITE_CONFIG_LSB1: i0aC980<br>WRITE_CONFIG_LSB2: i0ad140<br>WRITE_CONFIG_LSB3: i0ad900<br>WRITE_CONFIG_LSB4: i0ae0c0<br>WRITE_CONFIG_LSB5: i0ae880<br>WRITE_CONFIG_LSB6: i0af040<br>WRITE_CONFIG_LSB7: i0af800<\/p>\n\n\n\n<p>After WRITE_CONFIGX command tag returs given command or nothing if page not writable. After that mode data MSB(lock bit and mode) or LSB(lock bit and size) can be written with command (one byte) i08XX. Tag does not respond anything for that. <br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Windows Application<\/strong><\/h2>\n\n\n\n<p>Segment 0 is storing all relevant information for authentication. Key ID is located at 32 first bits (E0 23 95 63). After that there is factory default 128 bit crypto key (11 11 22 22 33 33 44 44 55 66 66 77 77 88 88)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"656\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-16.png\" alt=\"\" class=\"wp-image-397\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-16.png 687w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/kuva-16-300x286.png 300w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Hitag Pro<\/strong><\/h2>\n\n\n\n<p>Command set:<br><br>Read IDE: 0011<br><br>Plain authenticate XMA: 0000 0000 XXXX&#8230; Where XXXX is IDE read from the card(32bit)<br><br>Segment configuration: 1111 1111 XXXX&#8230; Where XXXX is IDE read from the card(32bit)<br><br>Select Segment\/block:  1101 1AAA BBBB Where AAA is segment and BBBB block<br><br>Read page: 0000 0AAA Where AAA is page address<br><br>Write page: 1000 0AAA XXXX&#8230; YY.. Where AAA is page address and XXXX data to be written (32bit), YY = CRC8(8bit)<br><br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"653\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-3.png\" alt=\"\" class=\"wp-image-457\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-3.png 699w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-3-300x280.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Hitag2 Extended<\/strong><\/h2>\n\n\n\n<p>Command set:<br>Very similar to AES but with minor differences:<br>Enter XMA state: 00000<br>READ_PAGE bit format: 11XXX + inv<br>WRITE_PAGE bit format: 10XXX + inv<br>SELECT_SEGMENT bit format: 00XXX + inv<br><br>Enter XMA config state: 10100<br>READ_CONFIG bit format: 01XXX + inv<br>WRITE_CONFIG_MSB bit format: 10XXX + inv<br>WRITE_CONFIG_LSB bit format: 11XXX + inv<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"653\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-2.png\" alt=\"\" class=\"wp-image-442\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-2.png 699w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/03\/kuva-2-300x280.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Hitag2 BMW EE<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"653\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/05\/bmwHT.png\" alt=\"\" class=\"wp-image-467\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/05\/bmwHT.png 699w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/05\/bmwHT-300x280.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>VVDI SuperChip, XT27A<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"653\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/kuva-1.png\" alt=\"\" class=\"wp-image-473\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/kuva-1.png 699w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/kuva-1-300x280.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Hitag AES Encrypted Mode<\/strong><\/h2>\n\n\n\n<p>Got some crucial help from one friend for AES encrypted protocol. So, here it is implemented.<\/p>\n\n\n\n<p>Communication is established with secure handshaking. After that Hitag AES transponder goes directly to XMA mode. So, it is not possible to change segment configuration in that mode. Segment configuration is always done in plain mode.<\/p>\n\n\n\n<p>Ciphered mode offers possibility to check and modify segments that are encrypted and locked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Hitag AES encrypted protocol<\/strong><\/h3>\n\n\n\n<p>Handshaking is done by sending random data (challenge) to transponder. Random number with IDE is used as seed for crypt data. Both sides do the same AES calculation. Next step ABIC sends 16 bit of crypt data to transponder. If that match for transponder calculation, transponder replies next 48 bit of crypt data. ABIC side then verifies data and hadshaking done.<\/p>\n\n\n\n<p>Next steps are always based on crypting again full output of earlier step crypt data. New data is then used as mask and crypted message is formed with XOR operation with necessary amount of bits.<\/p>\n\n\n\n<p>Data is not ever decrypted with AES algorithm. XORing algorithm is always used both sides.<\/p>\n\n\n\n<p>You may test AES encryption with online tool like this: <a href=\"https:\/\/testprotect.com\/appendix\/AEScalc\">https:\/\/testprotect.com\/appendix\/AEScalc<\/a> <\/p>\n\n\n\n<p>Visual Studio has crypto class RijndaelManaged that can be used to encrypt messages with mode CipherMode.ECB<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/kuva-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/kuva-2-1024x723.png\" alt=\"\" class=\"wp-image-812\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/kuva-2-1024x723.png 1024w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/kuva-2-300x212.png 300w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/kuva-2-768x542.png 768w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/kuva-2.png 1247w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Application<\/strong><\/h3>\n\n\n\n<p>User can select encrypted protocol by checking check box and giving AES crypto key. AES protocol is high energy consuming. Transponder needs to be carefully located on transmitter coil to tranfer all needed energy.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"678\" src=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/8E7E7DF2-2A37-4B43-AE30-91DEE8000A41.png\" alt=\"\" class=\"wp-image-806\" srcset=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/8E7E7DF2-2A37-4B43-AE30-91DEE8000A41.png 705w, https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/01\/8E7E7DF2-2A37-4B43-AE30-91DEE8000A41-300x289.png 300w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Hitager AES crypto mode application package (Windows binary only):<\/p>\n\n\n\n<p><a href=\"https:\/\/kivijakola.fi\/share\/hitager\/hitager_aes_crypto.zip\">https:\/\/kivijakola.fi\/share\/hitager\/hitager_aes_crypto.zip<\/a><\/p>\n\n\n\n<p>Source code<\/p>\n\n\n\n<p><a href=\"https:\/\/kivijakola.fi\/share\/hitager\/sources_aes_crypt.zip\">https:\/\/kivijakola.fi\/share\/hitager\/sources_aes_crypt.zip<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Videos<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"hitagAES\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/EDyTZEQt4n8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Hitag2 card reset to factory secrect key\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/tZCXzXQB9Bc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"clioIV aes card reading\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/Z45vX8KhwJQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">Going through Clio IV original used Hitag AES key card. Segment 0 is locked but all other data can be read.<br><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"PCF7939MA AES initialization\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/Ffd_AdvchiA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">Initializing total empty PCF7939MA AES transponder tag with Hitager. Segment configuration must be written first. Then set crypto key and finally set segment mode as crypted<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"vvdi super\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/fCvu8laguUk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">Playing with VVDI SuperChip<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Hitag AES encrypted mode\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/xgJi7J-Z6CA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">Hitag AES crypto mode reading and writing locked block<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/04\/Hitager.zip\"><br>Hitager Windows application (update 2.4.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/04\/Hitager.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/05\/Hitager_BMW.zip\">Hitager Windows application (Support for BMW 26.5.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/05\/Hitager_BMW.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/Hitager_SuperChip.zip\">Hitager Windows application (Support for VVDI SuperChip 13.6.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/Hitager_SuperChip.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/Hitager_SuperChip2.zip\">Hitager Windows application ( VVDI SuperChip fix 14.6.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/Hitager_SuperChip2.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/Hitager_SuperChip3-1.zip\">Hitager Windows application ( VVDI SuperChip fix 15.6.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/06\/Hitager_SuperChip3-1.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/HitagerSetup-1.zip\">Hitager Windows application setup package (28.2.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/02\/HitagerSetup-1.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<p>Example of AES key programming with Renault ECU Tool programmer to precode cards: <a rel=\"noreferrer noopener\" href=\"http:\/\/www.immo-tools.lt\/site\/files\/failai\/X98_AllCardsLost.pdf\" target=\"_blank\">http:\/\/www.immo-tools.lt\/site\/files\/failai\/X98_AllCardsLost.pdf<\/a> Yes! you can do the same with this open source projet!<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/04\/sources.zip\">Visual studio C# Source Codes(2.4.2021)<\/a><a href=\"https:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/04\/sources.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/12\/sources.zip\">Visual studio C# Source Codes (9.12.2021)<\/a><a href=\"http:\/\/kivijakola.fi\/projektit\/wp-content\/uploads\/2021\/12\/sources.zip\" class=\"wp-block-file__button wp-element-button\" download>Lataa<\/a><\/div>\n\n\n\n<p>Source codes available at GitHub: <a href=\"https:\/\/github.com\/kivijakola\/hitager\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/kivijakola\/hitager<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hardware It is needed some 125kHz RFID reader to be able to communicate with Hitag key tags. In this project we use old Renault car card reader that is fairly well (cheap) available in scrapyards and uses PCF7991 base station IC that has also well documented datasheet available. Source codes available at GitHub: https:\/\/github.com\/kivijakola\/hitager\/tree\/main\/Arduino Now &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/kivijakola.fi\/projektit\/2021\/01\/27\/hitag-open-source-tool\/\" class=\"more-link\">Jatka lukemista<span class=\"screen-reader-text\"> &#8221;Hitag2 and AES Open Source Key Programmer&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,6,1],"tags":[],"class_list":["post-211","post","type-post","status-publish","format-standard","hentry","category-auto","category-elektroniikka","category-yleinen"],"_links":{"self":[{"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/posts\/211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/comments?post=211"}],"version-history":[{"count":134,"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/posts\/211\/revisions"}],"predecessor-version":[{"id":818,"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/posts\/211\/revisions\/818"}],"wp:attachment":[{"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/media?parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/categories?post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kivijakola.fi\/projektit\/wp-json\/wp\/v2\/tags?post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}