Giter Site home page Giter Site logo

dotnicht / wasm-fingerprint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drbh/wasm-fingerprint

0.0 0.0 0.0 288 KB

๐Ÿ–– Fast, small, reliable, embeddable browser canvas fingerprinting implemented in WebAssembly.

JavaScript 1.98% Python 0.15% Rust 0.23% HTML 0.03% WebAssembly 97.61%

wasm-fingerprint's Introduction

WASM-FINGERPRINT

Disclaimer: This program is for educational purposes. Internet privacy is important and this tool should not be used for fingerprinting unknowing/unwanting subjects.

Fast, small, reliable, embeddable browser canvas fingerprinting implemented in WebAssembly.

We use your browsers canvas rendering engine to create a unique fingerprint for every computer+browser pair.

๐Ÿ†• TRY IT ON YOUR BROWSER

https://drbh.github.io/wasm-fingerprint/

Try opening the same window in private browser mode, is the fingerprint the same?

Usage

const wf = new WasmFingerprint();
wf.make_fingerprint()
// {ms: 3.3350000012433156, print: "CB2BFCAB"}

What is Browser Finger Printing?

Every computer and browser engine renders a slightly diffrent canvas output when drawing the image on screen due to the slight discrepencies in both the soft and hardware.

At the image format level โ€“ web browsers use different image processing engines, image export options, compression level, the final images may get different checksum even if they are pixel-identical. At the system level โ€“ operating systems have different fonts, they use different algorithms and settings for anti-aliasing and sub-pixel rendering. browserleaks

Example of variations

Essentially this allows us to track a user without cookies or any other persisted method. We use the unique user's computer to generate a fingerprint on page load.

๐Ÿƒโ€โ™‚๏ธ Run Example (โœจ Updated)

cd web-example

## start a server 
# npm install http-server -g
http-server

## navigate to localhost:8080
# open developer tools

Now in the console type:

const wf = new WasmFingerprint();
wf.make_fingerprint()
// {ms: 3.3899999980349094, print: "CB2BFCAB"}

// // โœจ YOUR BROWSER FINGERPRINT SHOUD BE LOGGED TO THE CONSOLE ๐ŸŽ‰ 

The ms refers to the milliseconds wasm-fingerprint took to add, draw and hash the canvas objects needed to create a unique print. The print is the 99+% unique id.

This id's entropy is from the hard and software so it should be static as long as the user does not change those things.

What this allows us to do is track a user without any cookies. For instance their fingerprint will be identical in normal and private browsing mode.

Notes on using

This library is still in development and we are looking for the best way to make this library accessible to developers. Here are some notes on how to get it working now, what files you'll need and what files might need to be tweeked

pkg/index.html

This file imports the JS shim that makes the WASM binary work, this file alos lives in the pkg folder

<script src="./wasm_fingerprint_mod.js"></script>

pkg/wasm_fingerprint_mod.js

This files fetches and manages the wasm binary when loaded in the browser. If you use this in your own app or host the JS and WASM file, you'll likely need to change the path. This is in the init function

// you'll have to change the first line of this function
function init(module) {
    module = "/wasm_fingerprint_bg.wasm"
...

How wasm-fingerprint works

Steps

  1. load WASM and JS shim
  2. generate canvas div and append to body (invisibly)
  3. draw different colored text on canvas
  4. dump canvas data to uri
  5. hash data uri to low collision (but fast and short) fingerprint

Performance

runtime <20 ms
avg runtime ~5 ms

Run Webpack Example

wasm-pack build --target bundler
cd runme/
npm install
npm start

wasm-fingerprint's People

Contributors

drbh avatar dotnicht avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.