The long-awaited C# (.net/mono) wrapper for the great fprint library
C# C
Switch branches/tags
Nothing to show
Clone or download
Latest commit 4542b0a Jul 18, 2018

Analytics Build Status Build status


The long-awaited C# (.net/mono) wrapper for the great fingerprint reader interfacing library libfprint Note: A few people have reported a System.DllNotFoundException being thrown at runtime. This is a Linux project. There is no libfprint.dll for Windows

From the libfprint website:

libfprint is an open source software library designed to make it easy for application developers to add support for consumer fingerprint readers to their software.

This wrapper makes interfacing with your fingerprint reader extremely easy.

Simple guidelines

  • Use the FingerprintDeviceManager to discover connected fingerprint devices
  • Use the FingerprintDevice objects provided by the device manager to Enroll, Verify and Identify fingerprints
  • Use the FingerprintGallery to keep a database of fingerprints to match against. You can load the contents of the gallery from files, a database or pretty much any byte array prodiced by the Enroll functionality.
  • Finally, (and optionally) use the PgmFormatReader to turn PGM image files to Bitmaps
  • Have fun!

Super quick code example

using (var manager = FingerprintDeviceManager.Instance)
  using (var gallery = new FingerprintGallery())
    var device = manager.DiscoverDevices().FirstOrDefault();
    var enrollResult = device.EnrollFingerprint("enroll.pgm");
    if (enrollResult.IsEnrollComplete)
      var isVerified = device.VerifyFingerprint(enrollResult, "verify.pgm");
      if (isVerified)
        gallery.Add("username_gose_here", enrollResult);
    var identified = device.IdentifyFingerprint(gallery, "identify.pgm");

Getting it to run on the Raspberry Pi (Raspbian)

Raspbian has a fairly outdated libfprint-dev package (0.4.0). The following script will remove the installed libfprint-dev, install dependencies, pull code from 0.5.1, build it, and install the library.

sudo apt-get remove -y libfprint-dev
sudo apt-get autoremove -y
sudo apt-get install -y libusb-1.0-0-dev
sudo apt-get install -y libnss3-dev
sudo apt-get install -y libgtk2.0-dev

tar xf libfprint-0.5.1.tar.xz
rm libfprint-0.5.1.tar.xz
cd libfprint-0.5.1
sudo make install
sudo make clean
cd ..
sudo cp /usr/local/lib/
sudo find / -iname ""

You will also obviously want to install mono for any of the above to work . . .

sudo apt-get install mono-complete


The identification logic seems to be fairly slow when we start adding many fingerprints. Maybe using thislibrary for imaging and then using something like SourceAFIS for identification would work better...


Thanks to the libfprint developers!