Powered by Private Identity® - https://private.id
CryptoNets™ is extremely fast, accurate and efficient face, voice and fingerprint identity Android library with full privacy.
- Face biometric capture
- Encrypted face recognition every 200ms
- 1:N biometric match in 60ms constant time
- Human age estimation
- Unlimited users (unlimited gallery size)
- Fair, accurate and unbiased
- Preserves user privacy with neural network cryptography + fully homomorphic encryption (CryptoNets)
- IEEE 2410 Standard for Biometric Privacy, ISO 27001, ISO 9001 compliant
- Exempt from GDPR, CCPA, BIPA, and HIPAA privacy law obligations
- Predicts in 50ms with or without network using local storage
- Sign up on the wait-list on https://private.id to obtain your API Key and Server URL.
- Use Gradle
// project's gradle or settings.gradle
repositories {
maven { url 'https://jitpack.io' }
}
// app's gradle
implementation 'com.github.openinfer:cryptonets-lib:1.1.5'- Or download and add the
*.AARmanually from this repository.
- Warning: all methods except the
initializationprocess should be called off UI thread to avoid ANR issue.
- initialize the library once only in your application class
val config = PrivateIdentityConfig
.Builder(context, "Your api key", "your server URL")
.localStorage("Your storage path") // optional - default is your internal app's folder
.logEnabled(true) // optional - default is false
.build()
val pi = PrivateIdentity(config)- This is the class that converts
Bitmaptobytesto interact with the library.
val bitmap = yourLoadImageMethod()
val imageData = ImageData(bitmap) // this should be call off UI thread to avoid ANR- The function detects if there is a valid face in the 'ImageData` object:
val faceValidateResult = privateIdentity.isValid(imageData)- In
faceValidateResult, we haveageFactorandfaceValidation:
public enum FaceValidation {
InvalidImage(-100),
NoFace(-1),
ValidBiometric(0),
ImageSpoof(1),
VideoSpoof(2),
TooClose(3),
TooFaraway(4),
TooFarToRight(5),
TooFarToLeft(6),
TooFarUp(7),
TooFarDown(8),
TooBlurry(9),
GlassesOn(10),
MaskOn(11),
ChinTooFarLeft(12),
ChinTooFarRight(13),
ChinTooFarUp(14),
ChinTooFarDown(15),
ServerError(27),
}- The function detects if there is a valid face in the
ImageDataobject and tries to authenticate a user on back-end
val facePredictResult = privateIdentity.predict(imageData)
// Result:
// - FacePredictResult - return null means invalid image
// - FacePredictResult - empty means user is not registered
// - FacePredictResult contains uuid, guid if the user is registered- Before registering a new user, we should check whether the image is valid or not:
val faceValidateResult = privateIdentity.isValidToEnroll(imageData)
if (faceValidateResult.faceValidation == FaceValidation.ValidBiometric) { // image is valid
val faceEnrollResult = privateIdentity.enroll(imageDataList) // the imageDataList must be not empty
// faceEnrollResult - returns null means failed
// faceEnrollResult contains uuid, guid if the process is running successfully
}- Note: we can
enrolla new user with a single image, but it's recommended to enroll with more than 5 images.
- If you want to delete user data from the back-end you can do it using the user identifier (uuid) previously obtained from
enrollorpredictmethod:
val faceDeleteResult = privateIdentity.delete(uuid)
// FaceDeleteResult - returns null if failed
// FaceDeleteResult object with status and message- This method is used to validate the face from frontside of a driver license:
val documentResult = privateIdentity.validateDocument(imageData)
if (documentResult.isValid) { // valid license
// documentResult.uuid
// documentResult.guid
} else {
// not a valid face
}- This function scans the barcode from backside of the license:
val barcodeResult = privateIdentity.validateBarcode(imageData)
if (barcodeResult.isValid) { // valid barcode
// barcodeResult.firstName
// barcodeResult.lastName
// ... Look at the BarcodeResult.java for more information
} else {
}- This method estimates ages of faces in the image
val ageEstimateResult = privateIdentity.estimateAge(imageData)
// print ageEstimateResult.toString()- Min Android SDK: CryptoNets™ requires a minimum API level of 21
- Compile Android SDK: CryptoNets™ requires you to compile against API 32 or lower. API 33 is not supported now.
This repository contains all available samples: https://github.com/openinfer/samples