fciv.py is a Python module that I implemented to generate file integrity data in a format used by Microsoft File Checksum Integrity Verifier. My use case involves copying files from a Linux workstation to a Microsoft Windows workstation. I wanted to generate integrity data on Linux using Python 3 and verify file integrity on Microsoft Windows without installing 3rd party software.
FCIV file content is generated with the following Python snippet:
digests = fciv.fciv_compute('mydirectory/**')
With the output of the generation script redirected to a file named ‘fciv.xml’, the following snippet performs verification:
reference_digests = fciv.fciv_read('fciv.xml')
actual_digests = fciv.fciv_compute('mydirectory/**')
The verification performed by fciv.py reports mismatches between expected and actual file checksums. Files missing from and files in addition to that of the verification data are also reported.