Skip to content
Back to skills

Data Integrity

ASecurity

Ensure integrity of data in storage and transmission using checksums/CRCs/ECC, validation, and redundancy where needed for medical devices.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 6, 2026
testing

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add lilinji/GeneTind-Life-Skills --skill data-integrity --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Integrity?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Integrity
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lilinji-data-integrity/badge)](https://www.skillsdirectory.com/skills/lilinji-data-integrity)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
skill_id: DATA-INTEGRITY
version: 1.0.0
last_updated: 2026-01-04
applies_to: [Class A, Class B, Class C]
jurisdiction: [Global]
prerequisites: [SEC-ENCRYPTION]
---

# Data Integrity

## Purpose
Ensure integrity of data in storage and transmission using checksums/CRCs/ECC, validation, and redundancy where needed for medical devices.

## When to Apply
- Storing or transmitting patient/therapy data, logs, configs, firmware.
- Safety-critical control or sensor data paths.

## Requirements (testable)
1. Checksums/CRCs: Apply CRC or MAC to critical data blobs and messages; verify before use. Rationale: detect corruption.
2. ECC/Redundancy: Use ECC or redundancy for persistent storage where feasible; handle correction/failure paths. Rationale: reliability.
3. Input Validation: Validate size/range/format before processing; reject malformed data. Rationale: prevent misuse and corruption.
4. Error Handling: On integrity failure, enter safe handling (retry, request retransmit, or safe state); log event. Rationale: safe recovery.
5. Versioning: Version stored data formats; migrate safely; verify after migration. Rationale: compatibility and integrity.

## Recommended Practices
- Include length and CRC fields in messages; keep CRC separate from payload.
- Use HMAC for integrity when authenticity is also needed.
- Periodically scrub/read-verify important data (configs/calibration) to detect bitrot.

## Patterns
CRC on message:
```c
// REQ-DINT-CRC-01; TEST-DINT-03
bool validate_msg(const uint8_t *buf, size_t len, uint16_t expected_crc) {
    return crc16(buf, len) == expected_crc;
}
```

ECC status handling:
```c
// REQ-DINT-ECC-02; TEST-DINT-05
if (ecc_corrected) log_event("ECC_CORRECTED");
if (ecc_uncorrectable) { enter_safe_state(); }
```

Versioned config:
```yaml
# REQ-DINT-VERS-03
config_version: 2
fields:
  - name: calib_factor
    crc: 0xABCD
```

## Anti-Patterns (risks)
- No integrity check on stored configs -> risk: silent corruption affecting therapy.
- Ignoring CRC failures -> risk: using bad data.
- Mixing versioned/unversioned data without migration -> risk: misinterpretation.

## Verification Checklist
- [ ] CRC/HMAC applied to critical data/messages and verified.
- [ ] ECC/redundancy used where feasible; correction paths handled.
- [ ] Inputs validated; malformed data rejected safely.
- [ ] Integrity failures trigger safe handling and logging.
- [ ] Data formats versioned; migrations verified.

## Traceability
- `REQ-DINT-###` to `TEST-DINT-###`; logs of integrity failures retained.

## References
- IEC 62304 (data/control integrity expectations).
- NIST SP 800-38 (for MAC modes) as informative.

## Changelog
- 1.0.0 (2026-01-04): Initial data integrity skill with CRC/ECC, validation, and versioning.

## Audit History
- **2026-01-04**: Audit performed. Verified:
  - NIST SP 800-38 reference for MAC modes appropriate as informative
  - CRC and ECC patterns technically accurate

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…