Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Key generation from fingerprint

Thread view: 
pvs - 01 Oct 2005 08:26 GMT
Hi,
How to get hashcode from a fingerprint image? Can we generate keys from
an input fingerprint image?Please give me some suggestion how to do
that.
Thanks,
PVS
steve - 09 Oct 2005 09:42 GMT
> Hi,
> How to get hashcode from a fingerprint image? Can we generate keys from
> an input fingerprint image?Please give me some suggestion how to do
> that.
> Thanks,
> PVS

which biometric device are you using?

does it return an image , or does it return some sort of mapping of the
print?

steve
pvs - 12 Oct 2005 23:25 GMT
Hi,
Thanks for your reply.
Actually what i am going to do is... i will take a fingerprint image
from database then using that fingerprint image i have to generate
public and private keys.I don't know how to do exactly.If you have any
idea please let me know.
Thanks,
PVS

> > Hi,
> > How to get hashcode from a fingerprint image? Can we generate keys from
[quoted text clipped - 9 lines]
>
> steve
steve - 13 Oct 2005 22:27 GMT
> Hi,
> Thanks for your reply.
[quoted text clipped - 18 lines]
>>
>> steve

go look at :
http://java.sun.com/docs/books/tutorial/security1.1/overview/

something like:
  Signature dsa = Signature.getInstance("SHA/DSA");
 PrivateKey priv = pair.getPrivate();

           dsa.initSign(priv);

 FileInputStream fis = new FileInputStream(args[0]);
           byte b;
           while (fis.available() != 0) {
               b = (byte) fis.read();
               dsa.update(b);
               };

           fis.close();

byte[] sig = dsa.sign();

you can see it is not that hard.
Roedy Green - 14 Oct 2005 08:41 GMT
>something like:
>   Signature dsa = Signature.getInstance("SHA/DSA");
>  PrivateKey priv = pair.getPrivate();
>
>            dsa.initSign(priv);

He just needs a digest, not a digitally signed digest, doesn't he?

See http://mindprod.com/jgloss/digest.html
http://mindprod.com/jgloss/md5.html
http://mindprod.com/jgloss/sha1.html
http://mindprod.com/jgloss/adler.html

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
* Test MD5 digest computation
*
* @author Roedy Green
* @version 1.0
* @since 2004-06-07
*/
public class MD5
  {

  /**
   * test MD5 digest, requires Java 1.4+
   *
   * @param args not used
   */
  public static void main ( String[] args ) throws
UnsupportedEncodingException, NoSuchAlgorithmException
  {
     byte[] theTextToDigestAsBytes = "The quick brown fox jumped over
the lazy dog's back".getBytes( "8859_1" /* encoding */ );
     MessageDigest md = MessageDigest.getInstance( "MD5" );
     md.update( theTextToDigestAsBytes );
     byte[] digest = md.digest();
     System.out.println( digest.length );
     // 16 bytes, 128 bits long
  }
  }

.
I think Adler should suffice. It is quick and generates 32 bits, all
you need for a hashCode.

// generate an 32-bit Adler checksum/digest
import java.io.UnsupportedEncodingException;
import java.util.zip.Adler32;

public class Adler
  {
  /**
  * test Adler digest
  * @param args not used
  */
  public static void main ( String[] args ) throws
UnsupportedEncodingException
     {
     byte[] theTextToDigestAsBytes = "The quick brown fox jumped over
the lazy dog's back".getBytes( "8859_1" /* encoding */ );
     Adler32 digester = new Adler32();
     digester.update( theTextToDigestAsBytes );
     // getValue produces a long to conform to the Checksum
interface.
     // Actual result is 32 bits long not 64!
     int digest = (int) digester.getValue();
     System.out.println( Integer.toHexString( digest ) );
     }
  }
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

pvs - 21 Oct 2005 05:25 GMT
Hi all,
Thank you very much for your reply's.
I tried the code you have written here.it is generating some key from
the text but my problem is....it should take fingerprint image as input
and from that we have to generate keys.
I am sorry if i am giving trouble.I told you that i am not a good
programmer.please help me how to proceed.
Can we give fingerprint image as input instead of the text in your
code? i mean with the same or similar code can we generate for the
fingerprint image?
Thanks,
PVS
Roedy Green - 21 Oct 2005 08:25 GMT
>Can we give fingerprint image as input instead of the text in your
>code? i mean with the same or similar code can we generate for the
>fingerprint image?

What form does your hardware provide the image, byte array, char
string? array of ints?  a number of fields?

It depends on that detail how to write a good hashCode and equals
method for you lookup.

It also depends on some collapsing. If you get the literal image, the
lookup key will not work since another crime scene image of the same
person will be slightly different.  Hopefully some custom software has
analysed the image and converted to it set of repeatable numbers.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

pvs - 22 Oct 2005 03:06 GMT
Hi,
My prof. told me to take a fingerprint image that is available in
internet like .bmp or .jpg images and from that i have to generate
keys. i don't know whether it is possible from an image like that or i
have to take the fingerprint directly from a fingerprint reader and
generate the keys? you said that if it is a leteral image the key will
not work so is there any other way to generate?
Thanks,
PVS
Roedy Green - 22 Oct 2005 03:50 GMT
>My prof. told me to take a fingerprint image that is available in
>internet like .bmp or .jpg images and from that i have to generate
>keys. i don't know whether it is possible from an image like that or i
>have to take the fingerprint directly from a fingerprint reader and
>generate the keys? you said that if it is a leteral image the key will
>not work so is there any other way to generate?

hmm. This is just a toy.  Sure, you can take a key from a bmp or any
other sort of image. The catch is to match you must use the EXACT same
image as a lookup key.  See http://mindprod.com/jgloss/hashcode.html
and http://mindprod.com/jgloss/adler.html
and http://mindprod.com/jgloss/hashmap.html
and http://mindprod.com/jgloss/hashtable.html
for how to create a 32-bit hashcode from such a byte array.

If  they key is off by even 1 bit, a hashMap won't find it. Obviously
this would be useless for matching sample fingerprints from crime
scene ones.

If you search google for "fingerprint encoding" or "fingerprint
analysis" you will discover there are all sorts of proprietary schemes
to look for features and encode them in under 200 bytes in a way that
a crime scene analysis would give a number the same or very close to
the original.

For "close to" you would use a TreeMap to look up fingerprints by
encoded fingerprint.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

pvs - 27 Oct 2005 16:19 GMT
Hi,
Thanks for your help.I will try as you mentioned.IF i have any question
i will contact you.
PVS
Roedy Green - 09 Oct 2005 11:51 GMT
>How to get hashcode from a fingerprint image?

The word "fingerprint" can mean literally a description of the ridges
on a human finger. It has many analogous meanings.

Computing a hash on a array of bytes can be done with any sort of
digest then folding it into 32 bits with XOR..  See
http://mindprod.com/jgloss/digest.html

You want something quick to compute, perhaps a CRC32 or an Adlerian.

The problem is you will find this fingerprint only if you have an
EXACT match.  So presumably you have done some sort of categorising so
that the slop difference between the original and the crime scene
print  won't ruin lookup.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.