ucoProject / UCO

This repository is for development of the Unified Cyber Ontology.
Apache License 2.0
73 stars 34 forks source link

HashNameVocab should have SHA-3 Hash Functions #526

Closed ajnelson-nist closed 1 year ago

ajnelson-nist commented 1 year ago

Background

FIPS-202 is the Standard that "specifies the Secure Hash Algorithm-3 (SHA-3) family of functions on binary data" (source: abstract).

UCO has a semi-open vocabulary HashNameVocab that lists some hash functions. It should be updated to include the SHA-3 functions specified in FIPS-202 section 6.1, which are spelled like this in that section:

Requirements

Requirement 1

UCO should standardize the representation of SHA-3 hash values, particularly with the spelling of their method names.

Risk / Benefit analysis

Benefits

Risks

The submitter is unaware of risks associated with this change.

Competencies demonstrated

Competency 1

Digital Corpora provides SHA2-256 and SHA3-256 hashes (documented here) for reference data distribution files. This page lists the hashes for zips of files grouped by content type, excerpted from Govdocs1.

Competency Question 1.1

I downloaded xlsx.zip from that "by-type" page. What are the hashes I should expect to see on my downloaded file, kb:File-461e84c3-..., using today's state of UCO?

Result 1.1

See especially kb:Hash-f1cf2eed-....

{
  "@context": {
    "kb": "http://example.org/kb/",
    "uco-core": "https://ontology.unifiedcyberontology.org/uco/core/",
    "uco-observable": "https://ontology.unifiedcyberontology.org/uco/observable/",
    "uco-types": "https://ontology.unifiedcyberontology.org/uco/types/",
    "uco-vocabulary": "https://ontology.unifiedcyberontology.org/uco/vocabulary/",
    "xsd": "http://www.w3.org/2001/XMLSchema#"
  },
  "@graph": {
    "@id": "kb:File-461e84c3-3418-4dc7-b2e5-d36d3d55002a",
    "@type": "uco-observable:ArchiveFile",
    "uco-core:hasFacet": [
      {
        "@id": "kb:ContentDataFacet-e451b4a1-4f4f-4863-818c-e9274dbf84c3",
        "@type": "uco-observable:ContentDataFacet"
        "uco-observable:hash": [
          {
            "@id": "kb:Hash-1a44ad0b-f1d4-4e2c-a79f-bae30910f65f",
            "@type": "uco-types:Hash",
            "uco-types:hashMethod": {
              "@type": "uco-vocabulary:HashNameVocab",
              "@value": "SHA256"
            }
            "uco-types:hashValue": {
              "@type": "xsd:hexBinary",
              "@value": "058ddd92e78d7c00d9b3ca624ad88b72b5e5a773e08dfbfcb467ccac00fe31da"
            }
          },
          {
            "@id": "kb:Hash-f1cf2eed-0d77-41db-af25-946ed583c14f",
            "@type": "uco-types:Hash",
            "uco-types:hashMethod": "SHA3-256",
            "uco-types:hashValue": {
              "@type": "xsd:hexBinary",
              "@value": "d5451b3f54809d23075246576093cc665e5bfcc00c134b3cde57cd8ea6f9f52d"
            }
          }
        ],
        "uco-observable:sizeInBytes": 5702506
      }
    ]
  }
}

Competency Question 1.2

What would be the new triple if standardizing the SHA-3 family?

Result 1.2

{
  "@context": {
    "kb": "http://example.org/kb/",
    "uco-types": "https://ontology.unifiedcyberontology.org/uco/types/",
    "uco-vocabulary": "https://ontology.unifiedcyberontology.org/uco/vocabulary/",
    "xsd": "http://www.w3.org/2001/XMLSchema#"
  },
  "@graph": {
    {
      "@id": "kb:Hash-f1cf2eed-0d77-41db-af25-946ed583c14f",
      "uco-types:hashMethod": {
        "@type": "uco-vocabulary:HashNameVocab",
        "@value": "SHA3-256"
      }
    }
  }
}

The above would replace this triple:

{
  "@context": {
    "kb": "http://example.org/kb/",
    "uco-types": "https://ontology.unifiedcyberontology.org/uco/types/",
    "xsd": "http://www.w3.org/2001/XMLSchema#"
  },
  "@graph": {
    {
      "@id": "kb:Hash-f1cf2eed-0d77-41db-af25-946ed583c14f",
      "uco-types:hashMethod": "SHA3-256"
    }
  }
}

Solution suggestion

Add these strings to vocabulary:HashNameVocab:

Coordination

ajnelson-nist commented 1 year ago

A pull request has not been implemented for this proposal just yet, but it should be expected to be quite similar in form to PR 334.