Nitgen fingerprint scanner (NGenBio) UDF

1 post in this topic

Hi guys! :)


I've created this UDF to work with Nitgen fingerprint readers that use NGenBio SDK. I'm working with Hamster DX for testing purposes:



So, the UDF still needs a lot of functionalities but what is already written is enough to do most of the tasks you would want to do with a fingerprint scanner (registering, authentication of a user, identification of a person among many users etc.).

I've put it on GitHub because it will be constantly updated. Also, if you want to help, feel free to clone and send pull requests :D


#include 'NGenBio.au3'

; Enumerate devices
$numberOfDevices = _NEnumerate() ; Enumerate all connected devices

If Not $numberOfDevices Then Exit ; no device connected

_NOpen() ; Open device (no argument = open latest connected device)

; ======================================================================
; Example 1: just get a fingerprint and display the string associated to it

MsgBox(0, "Your fingerprint means:", _NCapture())

; ======================================================================
; Example 2: verification (expecting for a specified person)

; Ask for name (to show how to work with payloads and store info on the fingerprint data)
$sName = InputBox("Test", "Enter your name")

$tmpData = _NEnroll($sName) ; Register a fingerprint (we will have a string to save in DB if we want; $sName will be saved together with the data)

If Not $tmpData Then Exit ; User canceled

$check = _NVerify($tmpData) ; Verify fingerprint (from the string that the registration gave us - it could have come from a database)

If $check Then
    MsgBox(0, '', 'That''s you, ' & $check & "!") ; Correct fingerprint
    MsgBox(0, '', 'That''s not you!') ; Wrong fingerprint

; ======================================================================
; Example 3: identification (expecting for anyone of a group of persons)

; Add the already saved FIR data from the previous example as ID #1
_NSearch_Add($tmpData, 1)

MsgBox(0, "", "You are now user 1. Please call someone else to register (or use different fingers/hand) to test the registration of a second person.")

$secondPersonName = InputBox("Test", "What's the name of the second person?")

; Get data
$secondperson = _NEnroll($secondPersonName)

_NSearch_Add($secondperson, 2)

; Let's ask for the fingerprint to search for
$capture = _NCapture()
$user = _NSearch_Identify($capture)
If $user Then
    MsgBox(0, "", "User: " & $user)
    MsgBox(0, "", "User not found!")

_NClose() ; Close device (no argument = close latest opened device)

Note that you must install NGenBio SDK (although my system is x64, I only had success after installing the x86 version). More details, documentation and link to download the SDK on the readme file.

Get it on Github

1 person likes this

My UDFs  _AuThread multithreading emulation for AutoIt · _ExtInputBox an inputbox with multiple inputs and more features · forceUTF8 fix strings encoding without knowing its original charset · JSONgen JSON generator · _TCPServer UDF multi-client and multi-task (run on background) event-based TCP server easy to do · _TCPClient_UDF multi-server and multi-task (runs on background) event-based TCP client easy to do · ParseURL and ParseStr functions ported from PHP · _CmdLine UDF easily parse command line parameters, keys or flags · AutoPHP Create documents (bills, incomes) from HTML by sending variables/arrays from AutoIt to PHP · (Un)Serialize Convert arrays and data into a storable string (PHP compatible) · RTTL Plays and exports to MP3 Nokia-format monophonic ringtones (for very old cellphones) · I18n library Simple and easy to use localization library · Scripting.Dictionary OOP and OOP-like approach · Buffer/stack limit arrays to N items by removing the last one once the limit is reached · NGBioAPI UDF to work with Nitgen fingerprint readers · Serial/Licensing system require license key based on unique machine ID from your users · HTTP a simple WinHTTP library that allows GET, POST and file uploads · Thread true AutoIt threads (under-dev) Classes _WKHtmlToX uses wkhtmlto* to convert HTML files and webpages into PDF or images (jpg, bmp, gif, png...) Snippets _Word_DocFindReplaceByLongText replace strings using Word UDF with strings longer than 255 characters (MSWord limit) rangeparser parser for printing-like pages interval (e.g.: "1,2,3-5") EnvParser parse strings/paths with environment variables and get full path Random stuff Super Mario beep sound your ears will hurt

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • jandings
      By jandings
      Hello there,
      I'm trying to query a REST API of a webservice, SHOPWARE to be precise. The API is very well documented ( but only using PHP. I tried some stuff but could not make it work.
      It should be very simple, because the following simply works in a Chrome-Browser:
      queries me for username and passphrase and then dumps order number 300.
      Now I try to do the same in AutoIt (based on the wonderful work of many contributors here):
      #include-once #include "..\INCLUDE\winhttp.au3" #include "..\INCLUDE\OO_JSON.au3" ;Proxy Config Global $oJSON = _OO_JSON_Init() Global $obj = "" Global $sUserName = "USERNAME" Global $sPassword = "PASSPHRASE" Global $sDomain = "" Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) JOC/0.1") ; without ie proxy settings $hConnect = _WinHttpConnect($hOpen, "https://" & $sDomain) ConsoleWrite ($hConnect & "#") $sReturned = _WinHttpSimpleSSLRequest($hConnect, "GET", $sUserName & ":" & $sPassword & "@" & $sDomain, Default ) ;$sReturned = _WinHttpSimpleSSLRequest($hConnect, "GET", $sDomain, Default, $sUserName & ":" & $sPassword) ;$sReturned = _WinHttpSimpleSSLRequest($hConnect, "GET", $sDomain, Default, , $sUserName & ":" & $sPassword ) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; See what's returned ConsoleWrite ($sReturned & "#" & @error) Whatever version I use (I tried the commented ones and many others), I always get a reply from Shopware:
      {"success":false,"message":"Invalid or missing auth"}
      At least this comes from Shopware. But there must be some format of the credentials that I don't know or understand.
      Any help?
    • DavidLago
      By DavidLago
      I have 5 DCs, and I need to create a scheduled task to run a script that will test the authentication time for each one of them, once every minute. (Then I'll use it within a log analyser to create graphics).
      I came up with a script using the great AD UDF (by water). First I tried using "for" and an array, but something was messing up the results, then I went for the dumb old fashioned way:
      #Include <ad.au3> #include <MsgBoxConstants.au3> Global $AdTestTime = "" Global $Timer1, $Timer2, $Timer3, $Timer4, $Timer5 = "" Global $sAD1 = "MYSERVER109" Global $sAD2 = "MYSERVER110" Global $sAD3 = "MYSERVER111" Global $sAD4 = "MYSERVER112" Global $sAD5 = "MYSERVER113" $Timer1 = Timerinit() _AD_Open("", "", $sAD1) _AD_Close() Local $fDiff1 = TimerDiff($Timer1) $Timer2 = Timerinit() _AD_Open("", "", $sAD2) _AD_Close() Local $fDiff2 = TimerDiff($Timer2) $Timer3 = Timerinit() _AD_Open("", "", $sAD3) _AD_Close() Local $fDiff3 = TimerDiff($Timer3) $Timer4 = Timerinit() _AD_Open("", "", $sAD4) _AD_Close() Local $fDiff4 = TimerDiff($Timer4) $Timer5 = Timerinit() _AD_Open("", "", $sAD5) _AD_Close() Local $fDiff5 = TimerDiff($Timer5) MsgBox(0,"", "MYSERVER109=" & $fDiff1) MsgBox(0,"", "MYSERVER110=" & $fDiff2) MsgBox(0,"", "MYSERVER111=" & $fDiff3) MsgBox(0,"", "MYSERVER112=" & $fDiff4) MsgBox(0,"", "MYSERVER113=" & $fDiff5) Still, something is off here. 
      The first AD to be tested is always the slowest one, by far, like 20 times slower. Then I started to suspect that the first one starts the "negotiation", and the following ones ride the gravy train.
      If I repeat the first code twice, All servers seem to have a similar result.
      $Timer1 = Timerinit() _AD_Open("", "", $sAD1) _AD_Close() Local $fDiff1 = TimerDiff($Timer1) $Timer1 = Timerinit() _AD_Open("", "", $sAD1) _AD_Close() Local $fDiff1 = TimerDiff($Timer1) $Timer2.... Am I right?
      Also, is there a better way to test the authentication time?
      Thanks for the help.
      - Dave
    • SpinningCone
      By SpinningCone
      I'm trying to build a script to call some functions of a web service. I have found this example for doing SOAP ?do=embed' frameborder='0' data-embedContent> so I assume I can manually read out the wsdl file and figure out how to hand build a payload to do what I want ( I think, honestly this is all new to me).

      the problem I have is that the service requires authentication via client certificate. and I can't seem to find any example of how to use a webservice like that with autoit. I *might* have a basic auth option to access the service too but that's not 100% and even if I can I don't know how to do basic auth in autoit either.

      is this possible with autoit it (with either auth)? can anyone point me to some code?
    • drego
      By drego
      You may have already seen the NetSession UDF thread. The code is really helpful for IE controls and there's no other known way to accomplish what it does. There are a few things that should be improved. The most important being able to pass proxy authentication to a proxy server using urlmon.dll or maybe some other windows API method alltogether.
      Here's our thread:  '?do=embed' frameborder='0' data-embedContent>>
      Give it a read and be sure to check out the attempt to improve by SmOke_N: page-2#entry1220599'>page-2#entry1220599
      Currently, since we have to pass proxy authentication via the URL, if the proxy requires authentication we can't access HTTPS sites with it (Apparently when using HTTPS you aren't allowed to pass auth in the URL). That's why we want to pass the auth through the DLL or any other method that will work with our embedded browser on a per-process basis.
      Thank you to anyone who can help make this UDF better.