Fingercrypt is a simple solution for secure fingerprint/biometric hashing which also supports comparison checks using permutations.
Fingercrypt allows for the secure storage of fingerprints while allowing for easy comparison checks! It uses OpenCV in order to process the image. Image processing is done in four simple steps. First, the image converted to a black and white form, with the lines of the fingerprint being white and the rest being black. Then, the finger's ridges are outlined using the Cv2 canny algorithm. After that, the region of interest is captured to crop out all unneccasary things that are not the actual fingerpint. After that, the Hough Lines Transform is applied to get the lines from the image, which are then consequently hashed.
Here is the process visualized:
Step three is not that visible, sorry about that!
Fingercrypt comes with 2 main methods, HashFingerprint
and CheckFingerprint
string HashFingerprint(string imgPath, bool inverseColors)
imgPath
- The relative path to the imageinverseColors
- True if the fingerprint's lines are darker than the finger
byte[] HashFingerprint(LineSegmentPoint[] lines, int linesPerChunk=1, int chunkSize=16)
lines
- The OpenCV2 Lines of the fingerprintlinesPerChunk
- How many lines are stored in every SHA-512 Hash. Tradeoff between computation time during checking and storage spacechunkSize
- [NOT IMPLEMENTED] The length (in bytes) of each SHA-512 Hash
bool CheckFingerprint(string hashedLines, LineSegmentPoint[] lines, float chunkPercentThresold, int chunkLength = 128, int linesPerChunk = 1, int allowedVariation = 1)
hashedLines
- The fingerprint hashchunkPercentThresold
- The minimum percentage of chunks that match in order for the hashes to be considered matchinglines
- The lines that are being checked against the fingerprint hashchunkLength
- [NOT IMPLEMENTED] The length (in bytes) of each SHA-512 HashlinesPerChunk
- How many lines are stored in every SHA-512 Hash. Tradeoff between computation time during checking and storage spaceallowedVariation
- The allowed variation of each point in a line that can still count as a match
LineSegmentPoint[] GetImageLines(Mat img)
img
- The image of a fingerprint that lines need to be retrieved from