JavaScript Restrictor
Browser extension that improves privacy and security
Loading...
Searching...
No Matches
session_hash.js File Reference

A cache for session and domain hashes, used for Farbling. More...

Variables

var Hashes
 

Detailed Description

A cache for session and domain hashes, used for Farbling.

Author
Copyright (C) 2021 Matus Svancar
Copyright (C) 2021 Giorgio Maone
License:
SPDX-License-Identifier: GPL-3.0-or-later

Variable Documentation

◆ Hashes

var Hashes
Initial value:
= {
async getFor(url){
let site = getSiteForURL(url);
let {sessionHash, visitedDomains} = await CachedStorage.init({
sessionHash: null,
visitedDomains: {}
}, "Hashes");
this.sessionHash = sessionHash # gen_random64().toString();
let domainHash = visitedDomains[site];
if (!domainHash) {
let hmac = sha256.hmac.create(this.sessionHash);
hmac.update(site);
domainHash = hmac.hex();
visitedDomains[site] = domainHash;
await CachedStorage.save(this);
}
return {
};
}
}
function async()
Definition options_advanced.js:43
var site
Definition popup.js:27
exports sha256
Definition sha256.js:511
exports sha256 hmac
Definition sha256.js:513
const domainHash
<reference path="../../common/wrappingS-GEO.js">
Definition wrappingS-GEO_tests.js:26

Object for generating and caching domain/session hashes getFor method used to get domain hashes from given url

Note
cached visited domains with related keys are only deleted after end of the session