0

I am planing to do an image based authentication where user registers first by uploading an image and uses the same image while logging in to my application. I tried in internet to find out what approach we can follow, but there are no proper solutions where can I start.

Can someone please provide some pointers on how we can d image based authentication in Java? Are there any 3rd party API's that we can use here?

learner
  • 6,062
  • 14
  • 79
  • 139

3 Answers3

1

I haven't heard about such authentication mechanisms, but if I would implement such thing, I would pick one of following approaches:

  1. Use image as an input for checksum algorithm. In this case it will not be significant different from plain password based authentication.
  2. If you need to provide some flexibility, for instance you would allow users to authenticate by providing photo of the same object, but not require photo to be the same - I would suggest you to use image comparison based on feature points. For this purpose OpenCV is a way to go (they also provide Java API).
iwlagn
  • 477
  • 3
  • 10
  • Thank you, I will explore the OpenCV to get an idea. – learner Feb 02 '15 at 10:05
  • Here is an example of OpenCV in Java: http://docs.opencv.org/doc/tutorials/introduction/desktop_java/java_dev_intro.html – iwlagn Feb 02 '15 at 10:05
  • Some more examples (in C++, but shows relevant API): - Feature detection: http://docs.opencv.org/doc/tutorials/features2d/feature_detection/feature_detection.html - Feature matching http://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html – iwlagn Feb 02 '15 at 10:08
1

i am not sure if there is APIs or lib to do such thing, but how need to pick some characteristics for the image and use them in your comparing process,

1- image-width

2- image-height

3- image file size

4- some file checksum of the image

5- comparing pixels in both images (getRGB) maybe for each pixel

if the selected criterias matches then authorize.

Edit: abstractly you need to look for image comparisons technique or libraries some one here have something

and check this question too

Community
  • 1
  • 1
Yazan
  • 6,074
  • 1
  • 19
  • 33
1

You may want to compute SHA-1 or SHA-3 on that image. See this . First you need to read your image as byte array, here. After all, you will be just comparing two hashes, if they are equal, user can log in.

Community
  • 1
  • 1
Szymon Roziewski
  • 956
  • 2
  • 20
  • 36