-
-
Save natmchugh/e8f08350a606dc68bbffbc0f6c44017b to your computer and use it in GitHub Desktop.
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>Paxton Fob converter</title> | |
| <style> | |
| table, th, td, div { | |
| border: 1px solid black; | |
| } | |
| td { | |
| min-width: 100px; | |
| } | |
| input, select,div, form, table { | |
| margin: 5px; | |
| padding: 5px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Paxton Fob Conversion</h1> | |
| <p> | |
| This page can be used to convert the data on a paxton fob to a 8 byte id suitable for emulating as a EM41X id and vice versa. It was written by natmchugh https://github.com/natmchugh. It uses only client side JavaScript and so you can use the page here or save it and run it locally, enjoy! | |
| </p> | |
| <p> | |
| The source code for this page can be found at https://gist.githubusercontent.com/natmchugh/e8f08350a606dc68bbffbc0f6c44017b/raw/paxton-covert.html | |
| </p> | |
| <div> | |
| <h2>Convert page 4 and 5 of data from a paxton tag to an ID</h2> | |
| <form onsubmit="convertToEm41x()"> | |
| <label for="page4">Page 4:</label><br> | |
| <input id="page4"><br> | |
| <label for="page5">Page 5:</label><br> | |
| <input id="page5"><br> | |
| <label for="page6">Page 6:</label><br> | |
| <input id="page6"><br> | |
| <label for="page7">Page 7:</label><br> | |
| <input id="page7"><br> | |
| <input type="submit" value="Convert"><br> | |
| </form> | |
| <table style="border:1px solid black"> | |
| <tr> | |
| <td>Decimal</td><td id="em41x_dec"></td> | |
| </tr> | |
| <tr> | |
| <td>Hex</td><td id="em41x_hex"></td> | |
| </tr> | |
| </table> | |
| <br/> | |
| </div> | |
| <div> | |
| <h2>Convert from an ID to the equivalent data on pages paxton fob</h2> | |
| <form onsubmit="convertPaxton()"> | |
| <label for="id">Id:</label><br> | |
| <input id="id"><br> | |
| <label for="type">Type:</label><br> | |
| <select id="type"> | |
| <option value="6">Net2 iso card</option> | |
| <option value="3">Net2 fob</option> | |
| <option value="2">Net2 iso magstripe</option> | |
| <!-- <option value="sf">Switch2 fob</option> | |
| <option value="sc">Switch2 shadow card</option> --> | |
| </select><br> | |
| <input type="submit" value="Convert"> | |
| </form> | |
| <table style="border:1px solid black"> | |
| <tr> | |
| <td>Page 4</td><td id="page4_result"></td> | |
| </tr> | |
| <tr> | |
| <td>Page 5</td><td id="page5_result"></td> | |
| </tr> | |
| <tr> | |
| <td>Page 6</td><td id="page6_result"></td> | |
| </tr> | |
| <tr> | |
| <td>Page 7</td><td id="page7_result"></td> | |
| </tr> | |
| </table> | |
| </div> | |
| </body> | |
| </html> | |
| <script> | |
| function convertToEm41x() { | |
| const page4 = BigInt(parseInt(document.getElementById('page4').value.replace(/ /g,''), 16)); | |
| const page5 = BigInt(parseInt(document.getElementById('page5').value.replace(/ /g,''), 16)); | |
| const page6 = BigInt(parseInt(document.getElementById('page6').value.replace(/ /g,''), 16)); | |
| const page7 = BigInt(parseInt(document.getElementById('page7').value.replace(/ /g,''), 16)); | |
| const testBit = (page7 >> 13n) & 1n; | |
| //bits 11 -> 30 page 5 then first 15 bits of page 6 then first 30 bits of page 4 then first 10 bits of page 5 | |
| let hex = (((page5 & 4194300n) >> 2n) << 55n) + ((page6 >> 17n) << 40n) + ((page4 >> 2n) << 10n) + ((page5 >> 22n)); | |
| let multiple = 1n; | |
| let mask = 15n << 35n; | |
| let skip = 40n; | |
| if (testBit !== 1n) { | |
| multiple = 2n; | |
| mask = 15n << 70n; | |
| skip = 80n; | |
| } | |
| let output = 0n; | |
| let num = i = 0n; | |
| let digit = 0n | |
| while (i < 8n) { | |
| num = hex & mask; | |
| skip -= 5n * multiple; | |
| mask = mask >> 5n * multiple; | |
| digit = (num >> skip & 15n); | |
| output = (output * 10n ) + digit; | |
| i++; | |
| } | |
| document.getElementById('em41x_dec').innerHTML = (output.toString(10)); | |
| document.getElementById('em41x_hex').innerHTML = (output.toString(16)); | |
| event.preventDefault(); | |
| } | |
| function getParity(n) | |
| { | |
| return ~(((BigInt(n) * BigInt("0x0101010101010101")) & BigInt("0x8040201008040201")) % BigInt("0x1FF")) & 1n; | |
| } | |
| function convertPaxton() { | |
| event.preventDefault(); | |
| const em41x = document.getElementById('id').value.replace(/ /g,'').padStart(8, 0); | |
| const type = document.getElementById('type').value; | |
| let result = 0n; | |
| em41x.split('').forEach( | |
| (digit, index) => { | |
| dec = BigInt(digit) | |
| dec = (getParity(dec) << 4n) + dec; | |
| result = (result << 5n) + BigInt(dec); | |
| if (index == 5) { result = result << 2n; } | |
| } | |
| ); | |
| if (type !== 'sf' && type !== 'sc') { | |
| result = (result << 22n) + 4128768n + BigInt(type); | |
| } | |
| document.getElementById('page4_result').innerHTML = result.toString(16).substr(0, 8); | |
| document.getElementById('page5_result').innerHTML = result.toString(16).substr(8, 16); | |
| // if ( type === 'sf') { | |
| // document.getElementById('page7_result').innerHTML = '0C201084'; | |
| // } else if (type === 'sc') { | |
| // document.getElementById('page7_result').innerHTML = '0C202084'; | |
| // } | |
| event.preventDefault(); | |
| } | |
| </script> |
Hi @natmchugh Thank you for your contribution. Could you help to get any Paxton python SDK? I am trying to read RFID tags using Paxton p75 reader .
Hi @natmchugh Thank you for your contribution. Could you help to get any Paxton python SDK? I am trying to read RFID tags using Paxton p75 reader .
AFAIK the P75 reader is made to be plugged into a paxton board and speaks a proprietary protocol . However I believe you can get them to speak the common Wiegand protocol with an activation card. There will be stuff in python for understanding Wiegand.
Hi @natmchugh appreciate your quick response. I am trying read using Wiegand protocol but instead of response page 4 or 5 , m receiving 8 characters string like 'F33C9E67'. here is code https://github.com/Rajan244/RFID/blob/main/wiegand.py ,
- how could received the response with page 4 - 5 ?
- what is the role of activation card here ?
many thanks.
At a guess the string F33C9E67 converts to paxton id 4080836199 which you can convert to here https://badcfe.org/paxton-covert to Page 4 90441132
Page 5 c1ce7f0006
Thank you for comment @natmchugh, actually the tag contains 29714856 value, don't know how can I fetch direct id/page 4-5/ hex.
view this file as html https://htmlpreview.github.io/?https://gist.githubusercontent.com/natmchugh/e8f08350a606dc68bbffbc0f6c44017b/raw/paxton-covert.html