Sleuth Kit Java Bindings (JNI)  4.12.1
Java bindings for using The Sleuth Kit
org.sleuthkit.datamodel.HashUtility Class Reference

Classes

class  HashResult
 
enum  HashType
 

Static Public Member Functions

static List< HashResultcalculateHashes (Content content, Collection< HashType > hashTypes) throws TskCoreException
 
static String calculateMd5 (AbstractFile file) throws IOException
 
static String calculateMd5Hash (Content content) throws IOException
 
static boolean isNoDataMd5 (String md5)
 
static boolean isValidMd5Hash (String md5Hash)
 
static boolean isValidSha1Hash (String sha1Hash)
 
static boolean isValidSha256Hash (String sha256Hash)
 

Detailed Description

Utility to calculate a hash for FsContent and store in TSK database

Definition at line 36 of file HashUtility.java.

Member Function Documentation

static List<HashResult> org.sleuthkit.datamodel.HashUtility.calculateHashes ( Content  content,
Collection< HashType hashTypes 
) throws TskCoreException
static

Calculate hashes of the content object.

Parameters
contentThe content object to hash
hashTypesThe types of hash to compute
Returns
A list of the hash results
Exceptions
TskCoreException

Definition at line 50 of file HashUtility.java.

Referenced by org.sleuthkit.datamodel.HashUtility.calculateMd5Hash().

static String org.sleuthkit.datamodel.HashUtility.calculateMd5 ( AbstractFile  file) throws IOException
static

Calculate the MD5 hash for the given FsContent and store it in the database

Parameters
filefile object whose md5 hash we want to calculate
Returns
md5 of the given FsContent object
Exceptions
java.io.IOException
Deprecated:
Use calculateHashes() instead

Definition at line 201 of file HashUtility.java.

References org.sleuthkit.datamodel.HashUtility.calculateMd5Hash().

static String org.sleuthkit.datamodel.HashUtility.calculateMd5Hash ( Content  content) throws IOException
static

Calculate the MD5 hash for the given FsContent

Parameters
contentcontent object whose md5 hash we want to calculate
Returns
md5 of the given FsContent object
Exceptions
java.io.IOException
Deprecated:
Use calculateHashes() instead

Definition at line 224 of file HashUtility.java.

References org.sleuthkit.datamodel.HashUtility.calculateHashes(), and org.sleuthkit.datamodel.HashUtility.HashType.MD5.

Referenced by org.sleuthkit.datamodel.HashUtility.calculateMd5().

static boolean org.sleuthkit.datamodel.HashUtility.isNoDataMd5 ( String  md5)
static

Determine if the passed in Hash value is that for no data (i.e. an empty file). Looking these values up or correlating on them causes lots of false positives.

Parameters
md5
Returns
True if it is the empty hash value

Definition at line 144 of file HashUtility.java.

static boolean org.sleuthkit.datamodel.HashUtility.isValidMd5Hash ( String  md5Hash)
static

Determines whether a string representation of an MD5 hash is valid.

Parameters
md5HashThe hash.
Returns
True or false.

Definition at line 109 of file HashUtility.java.

static boolean org.sleuthkit.datamodel.HashUtility.isValidSha1Hash ( String  sha1Hash)
static

Determines whether a string representation of a SHA-1 hash is valid.

Parameters
sha1HashThe hash.
Returns
True or false.

Definition at line 120 of file HashUtility.java.

static boolean org.sleuthkit.datamodel.HashUtility.isValidSha256Hash ( String  sha256Hash)
static

Determines whether a string representation of a SHA-256 hash is valid.

Parameters
sha256HashThe hash.
Returns
True or false.

Definition at line 131 of file HashUtility.java.


The documentation for this class was generated from the following file:

Copyright © 2011-2021 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.