Wiegand & OSDP Physical Access Control Protocols
Wiegand uses two dedicated 5V pulse wires (Data 0 and Data 1) to transmit card numbers unidirectionally. Modern installations upgrade to OSDP (Open Supervised Device Protocol) for bidirectional, AES-128 encrypted communication that prevents physical badge replay attacks.
Core Protocol Architecture & Specifications
- ✓ Wiegand 26-bit standard format: 1 leading parity bit, 8-bit facility code (0–255), 16-bit card ID (0–65,535), 1 trailing parity bit
- ✓ Wiegand 34-bit and 37-bit extended formats for enterprise and government high-security facilities
- ✓ OSDP v2.2 Secure Channel with 128-bit AES encryption preventing wiretapping and Flipper Zero replays
- ✓ Bidirectional OSDP diagnostics: tamper alarms, LED color switching, buzzer feedback, and offline supervision
- ✓ Direct interface with HID Aero, Honeywell Pro-Watch, Paxton, and Rosslare access control panels
public class WiegandDecoder
{
public static bool TryDecodeWiegand26(uint raw26Bits, out ushort facilityCode, out ushort cardNumber)
{
facilityCode = 0;
cardNumber = 0;
// Bit 25: Even Parity over bits 1-12
// Bits 24..17: Facility Code (8 bits)
// Bits 16..1: Card Number (16 bits)
// Bit 0: Odd Parity over bits 13-24
uint evenParityBit = (raw26Bits >> 25) & 1;
uint facility = (raw26Bits >> 17) & 0xFF;
uint card = (raw26Bits >> 1) & 0xFFFF;
uint oddParityBit = raw26Bits & 1;
// Calculate Even Parity on upper 12 bits
uint upper12 = (raw26Bits >> 13) & 0xFFF;
uint calcEven = (uint)(CountSetBits(upper12) % 2);
// Calculate Odd Parity on lower 12 bits
uint lower12 = (raw26Bits >> 1) & 0xFFF;
uint calcOdd = (uint)((CountSetBits(lower12) % 2 == 0) ? 1 : 0);
if (evenParityBit != calcEven || oddParityBit != calcOdd)
return false; // Parity check failed
facilityCode = (ushort)facility;
cardNumber = (ushort)card;
return true;
}
private static int CountSetBits(uint n)
{
int count = 0;
while (n > 0) { count += (int)(n & 1); n >>= 1; }
return count;
}
} Verified Hardware Implementations
Our engineering team has thoroughly tested and validated Wiegand & OSDP across the following reader models, embedded modules, and smart transponders:
Target Deployments
- Automated vehicle boom barrier parking access
- Corporate office turnstiles
- High-security server room access
- University dorm entry
Deploy with OpenRFID
Integrate Wiegand & OSDP into your ERP, warehouse software, or custom mobile app with pre-built C# / C++ drivers.