Python has BIOMETRIC support?!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I recently spent some time researching what sort of biometric support python had so you know sort things like fingerprints you know sensors and whatever and I found some stuff I was looking for but not quite everything so there is Touch ID support there is Pass Key support which I'll probably talk about another time but there wasn't anything like Windows hello support and various other fingerprint sensors had various different libraries that only catered for certain things so the world of python Biometrics is a bit weird at the moment so this video is going to focus quite heavily on the touch ID side of things cuz that's what I was able to find but I do spend some time at the end talking about a potential implementation for Windows Hol fingerprint style stuff using something called python net so if you're interested in that stuff then potentially stick around to the end of course if you find this video help for any point then consider like it to let me know and maybe subscribing if you want to see more videos like this if you're feeling particularly generous you can become either a member or a patron using the links in the description below with all that of the way let's put this to use so to install the library on our system all we need to do is PIP install and then we need to install it from a GitHub repository cuz it's not on the python package index at the moment so we could do git plus https colon colon or colon github.com power foxia SL python dt- ID the most eagle-eyed among you will notice that this is actually my GitHub profile this is not my project I do want to stress that I simply forked it and made a few few updates to it the original version hadn't been updated in 7 years amazingly enough it still worked perfectly uh so I just you you know changed a few calls and optimized a few things added typing to it and stuff like that but the original project is no longer on the python package index and I don't want to put it back up without asking if it's okay first I could probably do it fine but in good faith I don't want to do that uh cuz he took it down for a reason so yeah uh but we can install that and that will install from the GitHub repository and then we will install also some Pi Objective C stuff because that's what this is built on and I will show the implementation in a bit uh but basically Pi Objective C is a bridge between Python and Objective C so it's not even really a wrapper it is just a bridge for it I imagine that's all handled in here and then you have these different Frameworks that just wrap the different things uh and Objective C is an apple technology uh so that's how this has been gotten to work and that's also why this is kind of a Macos SL iOS well actually not anymore um yeah like any Apple computer with a fingerprint sensor will work with this uh pretty much is what I'm saying uh so to actually use it we just need to do import Touch ID like that and if we do if name equals Main we can print Touch ID do is available and this will tell us if the touch ID system is available on our computer and if we do a script like that we can see that it is because I'm running this on a mapbook once we've done that we can simply do touch id. authenticate and we run that and we'll see it's quite small so I have to zoom it in but it is actually asking us for authentication with our Touch ID and if I had to do that it worked works so the true indicates that the authentication was successful and that everything was fully authenticated just fine and that pretty much covers the entire public API for this package the only other thing you can do is you can actually um change the reason for it so we can set reason here and we can do for the memes and if we run the script again we'll see that F 3.12 is trying to for the memes because I've I've done that well so yeah it it after is's trying to so the reason will go here if we then cancel it as well we'll get an error saying the authentication was canceled so if we head over to a Firefox window this is uh the fork that I've done uh so as you can see I made it typed and this is the entire code for it so I would be lying if I said I understood what everything in this did uh I might actually bring up the blame just so you can see how much I actually well actually I changed quite a bit in terms of styling and stuff I won't do that um but we have our local authentication stuff so this is all from um the from the pi Objective C framework then we create a a dll of none which I tried to look up what that did there were answers I don't understand them if someone understands what the hell this does and do let me know I did actually have to change this because the there are two ways to do this and one of them throws a typing error so that's fun it does all this um semaphore stuff this is necessary otherwise object c will have an absolute fit we then have some stuff for typing here we have our is available which just evaluates the policy our authentication we check if it's available first we create a new context a new semaphor and we have this callback so this evaluate policy localized reason reply takes our kouch ID policy which is essentially you know our Touch ID thing and the evaluate policy runs our Touch ID stuff I guess and then we pass in a reason and this is just a string and then we pass in a call back which is this which takes a success and an error so this will be either true or false and then the error will be you know an error I couldn't figure out the exact type but the only thing we need on the error is a localized description so I just created a protocol for that hoay for typing so we create a result here with our success in our error and the reason we can't just error straight away is because we need to dispatch this semaphore and then we need to wait for it otherwise you'll get the equivalent well I was going to say the equivalent of the colal panic that's not true you'll get an unhandled error from Objective C directly and it's really unclean so we just wait for the semaphore to be dispatched and then if there was an error we uh raised the error at this point so there's actually not an awful lot of code to it really surprisingly enough it is just a bit weird to understand and the person that wrote this knows an awful lot about this stuff um awful lot more about this stuff than I do but the main reason I actually wanted to Fork it uh I mean all this stuff about the typing of stuff was just niceties the main reason I wanted to Fork it was this setup.py file so previously the installed required just Pi Objective C and there are a lot of Frameworks for this so if I do pii and do PI objective oh my god let's actually be able to type I'll zoom in in a we second there we go we can say is we have the core and then we have these Frameworks and you can see just how many Frameworks there are and if you uh pip install Pi Objective C you install all of them and I do mean all 153 154 of them there's a lot so changing it to just oops require the the local Authentication framework installs the core it installs all of its dependencies everything is like properly dependency mapped but it reduces the number of dependencies to four instead of 154 uh which is the main reason I wanted to do this the other reason I wanted to do this as well is because this code works fine if I go into the commits you'll see that the last commit that wasn't me uh oh can I just go into the commit history please was seven years ago it hasn't been updated in seven years and it still works and it was it was archived on that as well so I yeah I just wanted to show that it still worked and it was really cool my original plan for this video was to have a Windows hello in here as well for Windows computers apparently that doesn't exist there like no one has made a python package for Windows Holo fingerprint sensors yet the closest I can find is just various different libraries for like fingerprint sensors as this one finger reader that has been tested on like the r3x there's this one that's been tested on on um ganch zfm sensors uh you know there's all these different ones and there's another one for I forget what the bloody company is called now but there's a company that makes them let me see if I can actually find it this Ada fruit one so there's this Ada fruit one that's sold and you can buy and there is actually a PPI package to be able to link into this thing uh which is kind of cool I'm not sure if you can like just put this into any computer or whether or not it's a it's like a rasby pi thing but you can do that but I could not find any way to do it um just in pure python what I did find was that the windows hello API is a thing so there is a Windows Hollow API um and it sucks as far as I can tell it looks I mean this is all just nonsense really there's like an awful lot of Stu I I don't know like yeah um oh I don't know maybe this one I hadn't actually looked at this one oh this one looks as actually be a bit oh this one looks more useful actually but this is a c API which of course python doesn't support until you install python net which is a C or well specifically a net and a mono um it's not rapper is it a rapper I don't know it just kind of installs the entire uh net system into Python and then you can start installing importing stuff from here so I think the cleanest option to be able to import to or Implement something for Windows hello sorry is to do it is to to work out what calls you need and then do it in python net and then that will probably be fine I think I am planning on trying to do this I can't guarantee I'm going to have the time uh to do it because I do have a full-time job and everything but I do want to see if I can get this to work even though I have literally just binned off Windows I have a Macbook and a Linux computer that's pretty much all I use now um so perfect time to build a Windows hello system let me know in the comments if you plan to use this in your own project and if so how I want to know kind of How It's been used I want to know what sort of cool use cases you come up with it also let me know in the comments if you have any experience with python net uh because that might be quite useful if you could share some insights into that because I've never used I've used C before I've obviously used python before but I've never I've never done the two so it' be useful if you do have any experience with that to kind of share your experiences in the comments I'd like to say huge thank you to my amazing patrons and members on screen now especially M rajman the third for being so generous if you want to know all about a free alternative to GitHub co-pilot that I actually kind of like then I covered that in last week's video so make sure you go and watch that but I'll see you in the next one for whatever we do next
Info
Channel: Carberra
Views: 2,122
Rating: undefined out of 5
Keywords: pyfhon, pytho, pytbon, pytjon, ptyhon, pytyon, ptthon, pyyhon, pythn, pythoh, pythpn, ython, pytgon, pyhon, pytohn, phthon, oython, pthon, pyghon, pythoj, pythno, pythkn, ypthon, pytuon, lython, pyrhon, pythom, pythob, puthon, pgthon, python, pyhton, pythln, pythin, pytnon, pyton
Id: B_cAyrU1Jw0
Channel Id: undefined
Length: 11min 42sec (702 seconds)
Published: Mon May 13 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.