Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrbrmstr/hhhash
#️⃣ 🕸️ 👤 HTTP Headers Hashing
https://github.com/hrbrmstr/hhhash
cybersecurity hash http r rstats
Last synced: about 1 month ago
JSON representation
#️⃣ 🕸️ 👤 HTTP Headers Hashing
- Host: GitHub
- URL: https://github.com/hrbrmstr/hhhash
- Owner: hrbrmstr
- License: other
- Created: 2023-07-09T10:09:54.000Z (over 1 year ago)
- Default Branch: batman
- Last Pushed: 2023-07-10T14:42:42.000Z (over 1 year ago)
- Last Synced: 2024-08-13T07:11:13.591Z (3 months ago)
- Topics: cybersecurity, hash, http, r, rstats
- Language: R
- Homepage:
- Size: 27.3 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - hrbrmstr/hhhash - #️⃣ 🕸️ 👤 HTTP Headers Hashing (R)
README
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![R](https://github.com/hrbrmstr/hhhash/workflows/R/badge.svg)](https://github.com/hrbrmstr/hhhash/actions?query=workflow%3AR)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-4.0.0-blue.svg)
![License](https://img.shields.io/badge/License-MIT-blue.svg)# hhhash
HTTP Headers Hashing
## Description
HTTP Headers Hashing (HHHash) is a technique used to create a
fingerprint of an HTTP server based on the headers it returns. HHHash
employs one-way hashing to generate a hash value for the set of header
keys returned by the server. See
for more info.## What’s Inside The Tin
The following functions are implemented:
- `build_hash_from_response`: Build a hash from headers in an curl
response object
- `build_hash_from_url`: Build a hash from headers retrieved from a URL
- `hash_headers`: Build a hash from a vector of HTTP header keys
- `sha256`: Convience wrapper for digest::digest() with algo = “sha256”
and serialize = FALSE## Installation
``` r
remotes::install_github("hrbrmstr/hhhash")
```NOTE: To use the ‘remotes’ install options you will need to have the
[{remotes} package](https://github.com/r-lib/remotes) installed.## Usage
``` r
library(hhhash)# current version
packageVersion("hhhash")
## [1] '0.1.1'
`````` r
build_hash_from_url("https://www.circl.lu/")
## [1] "hhh:1:78f7ef0651bac1a5ea42ed9d22242ed8725f07815091032a34ab4e30d3c3cefc"
`````` r
res <- curl::curl_fetch_memory("https://www.circl.lu/", curl::new_handle())build_hash_from_response(res)
## [1] "hhh:1:78f7ef0651bac1a5ea42ed9d22242ed8725f07815091032a34ab4e30d3c3cefc"
`````` r
c(
"Date", "Server", "Strict-Transport-Security",
"Last-Modified", "ETag", "Accept-Ranges",
"Content-Length", "Content-Security-Policy",
"X-Content-Type-Options", "X-Frame-Options",
"X-XSS-Protection", "Content-Type"
) -> keyshash_headers(keys)
## [1] "hhh:1:78f7ef0651bac1a5ea42ed9d22242ed8725f07815091032a34ab4e30d3c3cefc"
```## hhhash Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
|:-----|---------:|-----:|----:|-----:|------------:|-----:|---------:|-----:|
| R | 4 | 0.25 | 26 | 0.18 | 14 | 0.39 | 56 | 0.47 |
| C | 2 | 0.12 | 24 | 0.17 | 4 | 0.11 | 3 | 0.03 |
| JSON | 1 | 0.06 | 20 | 0.14 | 0 | 0.00 | 0 | 0.00 |
| YAML | 1 | 0.06 | 1 | 0.01 | 0 | 0.00 | 0 | 0.00 |
| SUM | 8 | 0.50 | 71 | 0.50 | 18 | 0.50 | 59 | 0.50 |{cloc} 📦 metrics for hhhash
## Code of Conduct
Please note that this project is released with a Contributor Code of
Conduct. By participating in this project you agree to abide by its
terms.