iOS library for device fingerprinting. Does not require server APIs to work, fully client-side operation.

Overview

FingerprintJS

Lightweight iOS library for local device fingerprinting

Supported platforms Pod version

Discord server

Installation (CocoaPods)

# Podfile
pod 'FingerprintJS'

Note: If you've never used CocoaPods for dependency management, check out their Using CocoaPods guide that will walk you through the setup process.

Quick Start (async/await - preferred)

import FingerprintJS
 
let fingerprinter = FingerprinterFactory.getInstance()
async {
    // Get fingerprint for the current device
    let fingerprint = await fingerprinter.getFingerprint()
    
    // Do something awesome with the fingerprint
}

Quick Start (closures - backwards compatibility)

import FingerprintJS 

let fingerprinter = FingerprinterFactory.getInstance()
fingerprinter.getFingerprint { fingerprint in
    // Do something awesome with the fingerprint
}

Fingerprint vs. DeviceId

FingerprintJS provides two main methods that return different kinds of identifiers:

  1. Device identifier retrieved by calling Fingerprinter::getDeviceId() that internally uses the identifierForVendor() method which returns a unique identifier for the current application (tied to the device). FingerprintJS further remembers this identifier in the keychain, making the identifier stable even between app reinstalls.

  2. Fingerprinter::getFingerprint() computes a device fingerprint by gathering device information (hardware, OS, device settings, etc.) and computing a hash value from available items. The fingerprint isn't currently as stable as the Device Identifier because the values might change between OS updates or when the user changes settings used to compute the previous value. Future library versions will provide an API with options to customize the stability of the fingerprint.

Configuration

Fingerprinter instance can be configured through the Configuration structure that provides options to select the fingerprint version or change the algorithm that is used to compute the individual fingerprints.

// note that this example exists only to illustrate the available options
// and that its outcome mirrors the current default configuration

let configuration = Configuration(version: .v1, algorithm: .sha256)
let fingerprinter = FingerprinterFactory.getInstance(config)

// fingerprinter uses version 1 of the fingerprint and SHA256 algorithm

Creating Custom Fingerprinting Function

The default hashing function which computes the fingerprint from the content data is SHA256. The Configuration structure offers a way to inject a custom hashing function by specifying .custom(YourCustomFingerprintFunctionInstance) in the algorithm variable:

class HitchhikersFunction: FingerprintFunction {
    func fingerprint(_ data: Data) -> String {
        return "42"
    }
}

let fingerprintFunction = HitchhikersFunction()
let config = Configuration(version: .v1, algorithm: .custom(fingerprintFunction))
let fingerprinter = FingerprinterFactory.getInstance(config)

let fingerprint = await fingerprinter.getFingerprint() // returns "42"

Keep in mind that the change in the supplied hashing function will inevitably lead to the change of the output fingerprint.

License

This library is MIT licensed. Copyright FingerprintJS, Inc. 2022.

Comments
  • feat: Add Swift Package Manager support

    feat: Add Swift Package Manager support

    Adds SPM support. If you want to add CI for the SPM stuff, I ran this locally in the repo root to validate I set things up correctly:

    xcodebuild test \
        -scheme FingerprintJS \
        -destination 'platform=iOS Simulator,name=iPhone 13'
    

    Also needed to add the Foundation import, otherwise the tests fail to compile under SPM.

    opened by Steven0351 3
  • Introduce API for customizing fingerprint stability level

    Introduce API for customizing fingerprint stability level

    The supported fingerprint stability levels are:

    • UNIQUE - indicates the use of every signal we were able to collect.
    • OPTIMAL - indicates the use of a combination of signals that don’t change and signals that might change, though not very often.
    • STABLE - indicates the use of hardware signals or signals that aren’t supposed to change at all.
    enhancement 
    opened by mgutski 0
  • Add `CellularNetworkInfoHarvester` for gathering cellular network info

    Add `CellularNetworkInfoHarvester` for gathering cellular network info

    The initial CellularNetworkInfoHarvester implementation includes two properties:

    • mobileCountryCodes for retrieving the mobile country codes (MCCs).
    • mobileNetworkCodes for retrieving the mobile network codes (MNCs).

    Both properties are of Array<String> type to correctly handle iPhones that support Dual SIM mode, as well as iPhones with multiple eSIMs.

    The introduced API is available on iOS only, i.e. tvOS is not supported. Also, in iOS 16 and later, the public API is deprecated, as a result of Apple deprecating CTCarrier API with no replacement. See https://developer.apple.com/forums/thread/714876 for details.

    enhancement 
    opened by mgutski 0
  • Add `deviceName` signal to device hardware info

    Add `deviceName` signal to device hardware info

    In iOS 16 and later, the public deviceName API is deprecated and always returns na empty string. This is due to Apple restricting the use of UIDevice.current.name with com.apple.developer.device-information.user-assigned-device-name entitlement, which cannot be requested if an app uses the user-assigned device name for tracking or fingerprinting.

    enhancement 
    opened by mgutski 0
  • Restore `Lint Code` build phase

    Restore `Lint Code` build phase

    The lint_code.sh script can now be run in one of the two modes: non-strict (default) or strict mode. The strict mode can be activated by suppling --strict option, which causes the script to report the lack of swift-format command as an error instead of a warning. Also, when run in strict mode, the script passes --strict option to swift-format tool to make it fail on lint warnings.

    The Lint Code Xcode build phase runs lint_code.sh script in non-strict mode, whereas make lint runs the same script with strict mode enabled.

    opened by mgutski 0
  • Pre-commit hook ensuring correct code formatting with `swift-format`

    Pre-commit hook ensuring correct code formatting with `swift-format`

    Reuses existing format_code.sh script and adds parameters that allows to run in on a single file (provided through a command line parameter). Includes the pre-commit hook script and environment setup in Makefile that sets the correct path to our custom hooks directory.

    opened by petrpalata 0
  • Introduce new CI workflow with code linting and unit tests

    Introduce new CI workflow with code linting and unit tests

    The linting is performed by swift-format and the unit tests are configured to run on both iOS and tvOS simulators.

    Includes:

    • Updated supported platforms for FingerprintJS and FingerprintJSTests targets to account for Apple TV platform.
    • Makefile to simplify the discovery and invocation of automated project tasks.
    • The fastlane was moved to DemoApp directory with an aim to use it for automating app distribution. The unit_tests lane was removed.
    opened by mgutski 0
  • Extract script phase for formatting code to separate script file

    Extract script phase for formatting code to separate script file

    The rationale behind this change was to ease the developers from the error-prone process of reviewing changes made in pbxproj file, where the configuration of build phases is stored.

    In addition, this commit fixes Xcode warnings related to misuse of script phase's "Based on dependency analysis" option.

    enhancement 
    opened by mgutski 0
  • Add `AppInfoHarvester` for collecting app-specific signals

    Add `AppInfoHarvester` for collecting app-specific signals

    The initial AppInfoHarvester implementation includes a single userInterfaceStyle property for retrieving the interface style for the app.

    The Light/Dark mode toggling was introduced in iOS 13, hence on iOS 12 the userInterfaceStyle property always returns light value.

    enhancement 
    opened by mgutski 0
Releases(1.2.0)
  • 1.2.0(Dec 21, 2022)

    What's Changed

    • Added 7 new signals: User Interface Style (iOS 13 and later), Screen Scale, OS Time Zone Identifier, Locale Identifier, Device Name (iOS 15 and earlier), Mobile Country Codes and Mobile Network Codes (iOS 15 and earlier). All new signals are included in fingerprint v3.
    • Added ability to customize fingerprint stability level. Starting with fingerprint v3, there are 3 different stability levels to choose from: unique, optimal and stable. See README for details.
    • Dropped support for Swift 5.3 and Swift 5.4.
    • Minor code improvements and increased code coverage.

    Full Changelog: 1.1.2...1.2.0

    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(Sep 14, 2022)

    • Added support for iOS 12 and tvOS 12
    • Default fingerprint computation uses SHA256 from CommonCrypto on iOS/tvOS 12 and CryptoKit on iOS/tvOS 13 and above.
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(May 15, 2022)

    • Add 2 new signals - total and free disk space, included within fingerprint v2
    • Introduce DeviceInfoProvider class that allows reading raw signal data collected for the fingerprint
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Mar 29, 2022)

    FingerprintJS 1.0.0

    First version of FingerprintJS's native iOS fingerprinting library.

    It has the following capabilities:

    • It's possible to generate a unique deviceId value through the Fingerprinter::getDeviceId() method
    • Computes device fingerprint that represents the current hardware/OS state of the device (Fingerprinter::getFingerprint())
    • Has the possibility to fetch raw data that are used to compute the fingerprint (Fingerprinter::getFingerprintTree())
    • Works strictly locally (no network traffic and no information shared with a third party)
    Source code(tar.gz)
    Source code(zip)
Owner
FingerprintJS
Fraud detection API for the Internet
FingerprintJS
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Cossack Labs 1.6k Dec 30, 2022
PGPro can encrypt and decrypt messages as well as manage all your OpenPGP keys. It is free, simple and lightweight. Everything stays on your device. PGPro is made in Switzerland.

PGPro can encrypt and decrypt messages as well as manage all your OpenPGP keys. It is free, simple and lightweight. Everything stays on your device. P

Luca Näf 250 Jan 4, 2023
CryptoExchange - A fully functional structure for Crypto Exchange app without using many third party assests

cryptoExchange A fully functional structure for Crypto Exchange app without usin

Shwait Kumar 0 Jan 6, 2022
PassDrop is a fully-featured secure password management system, compatible with the free KeePass 1.x (Classic) and multi-platform KeePassX desktop applications.

passdrop This is a modern, updated build of Rudis Muiznieks's PassDrop application. PassDrop is a fully-featured secure password management system, co

Chad Austin 33 Sep 23, 2022
A client library to multiplex connections from and to iOS devices

libusbmuxd A client library for applications to handle usbmux protocol connections with iOS devices. Features This project is a client library to mult

libimobiledevice 469 Dec 30, 2022
Send email to any SMTP server like a boss, in Swift and cross-platform

Hedwig is a Swift package which supplies a set of high level APIs to allow you sending email to an SMTP server easily. If you are planning to send ema

Wei Wang 1.1k Jan 3, 2023
Pass for iOS - an iOS client compatible with Pass command line application.

Pass is an iOS client compatible with ZX2C4's Pass command line application. It is a password manager using GPG for encryption and Git for version control.

Mingshen Sun 1.3k Dec 26, 2022
Two-Factor Authentication Client for iOS

Authenticator Two-Factor Authentication Client for iOS. Authenticator is a simple, free, and open source two-factor authentication app. It helps keep

Matt Rubin 770 Dec 30, 2022
Swift cross-platform crypto library using CommonCrypto/libcrypto

BlueCryptor Swift cross-platform crypto library derived from IDZSwiftCommonCrypto. IMPORTANT NOTE: This release is NOT entirely source code compatible

Kitura 183 Oct 15, 2022
A wrapper for Apple's Common Crypto library written in Swift.

IDZSwiftCommonCrypto A Swift wrapper for Apple's CommonCrypto library. IDZSwiftCommonCrypto works with both CocoaPods and Cathage. For more details on

idz 472 Dec 12, 2022
Swift cross-platform crypto library using CommonCrypto/libcrypto

BlueCryptor Swift cross-platform crypto library derived from IDZSwiftCommonCrypto. IMPORTANT NOTE: This release is NOT entirely source code compatible

Kitura 183 Oct 15, 2022
A powerful, protocol-oriented library for working with the keychain in Swift.

Locksmith A powerful, protocol-oriented library for working with the keychain in Swift. ?? iOS 8.0+ ?? Mac OS X 10.10+ ⌚️ watchOS 2 ?? tvOS ?? I make

Matthew Palmer 2.9k Dec 21, 2022
KeyClip is yet another Keychain library written in Swift.

KeyClip KeyClip is yet another Keychain library written in Swift. Features Multi Types ( String / NSDictionary / NSData ) Error Handling Settings ( kS

Shinichiro Aska 43 Nov 6, 2022
A library for make a beautiful Passcode Lock View

SmileLock A library for make a beautiful Passcode Lock View, also support Touch ID. Requirements iOS 9.0+ Swift 4 (pod version 3.x), Swift 3 (pod vers

Recruit Lifestyle Co. Ltd. 607 Sep 18, 2022
LocalAuth - Another Fusion library to implement the local authentication using Biometry

FusionLocalAuth Another Fusion library to implement the local authentication usi

Vedant Jha 0 Jan 13, 2022
SVPinView is a light-weight customisable library used for accepting pin numbers or one-time passwords.

SVPinView SVPinView is a light-weight customisable library used for accepting pin numbers or one-time passwords. Getting Started An example project is

Srinivas Vemuri 246 Jan 4, 2023
Oversecured Vulnerable iOS App is an iOS app that aggregates all the platform's known and popular security vulnerabilities.

Description Oversecured Vulnerable iOS App is an iOS app that aggregates all the platform's known and popular security vulnerabilities. List of vulner

Oversecured Inc 135 Dec 15, 2022
CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc

RNCryptor Cross-language AES Encryptor/Decryptor data format. The primary targets are Swift and Objective-C, but implementations are available in C, C

null 3.3k Dec 30, 2022