Package emissary.kff
Class Ssdeep
- java.lang.Object
-
- emissary.kff.Ssdeep
-
public final class Ssdeep extends Object
A java port of the ssdeep code for "fuzzy hashing". http://ssdeep.sourceforge.net There are a number of ports out there that all look basically the same. This one is from https://opensourceprojects.eu/p/triplecheck/code/23/tree/tool/src/ssdeep/ A new ssdeep hash gets calculated and saved at each level of unwrapping.
-
-
Field Summary
Fields Modifier and Type Field Description static intFUZZY_MAX_RESULT
-
Constructor Summary
Constructors Constructor Description Ssdeep()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(SpamSumSignature signature1, SpamSumSignature signature2)Given two spamsum signature return a value indicating the degree to which they match.StringfuzzyHash(byte[] data)Calculate the SpamSum hash for a byte array.StringfuzzyHash(SeekableByteChannelFactory sbcf)StringfuzzyHashFile(File file)Calculates the SpamSum hash for specified stream.StringfuzzyHashFile(String fileName)Calculates the SpamSum hash for specified file.static voidmain(String[] args)
-
-
-
Field Detail
-
FUZZY_MAX_RESULT
public static final int FUZZY_MAX_RESULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
fuzzyHash
public String fuzzyHash(byte[] data)
Calculate the SpamSum hash for a byte array.- Parameters:
data- The bytes to be hashed.- Returns:
- The SpamSum signature for the bytes.
-
fuzzyHash
public String fuzzyHash(SeekableByteChannelFactory sbcf)
-
fuzzyHashFile
public String fuzzyHashFile(File file) throws IOException
Calculates the SpamSum hash for specified stream.- Parameters:
file- The input file to be hashed.- Returns:
- The SpamSum signature for the file.
- Throws:
IOException- If there is some I/O problem accessing the file.
-
fuzzyHashFile
public String fuzzyHashFile(String fileName) throws IOException
Calculates the SpamSum hash for specified file.- Parameters:
fileName- The path to the file to be hashed.- Returns:
- The SpamSum signature for the file.
- Throws:
IOException- If there is some I/O problem accessing the file.
-
compare
public int compare(@Nullable SpamSumSignature signature1, @Nullable SpamSumSignature signature2)Given two spamsum signature return a value indicating the degree to which they match.- Parameters:
signature1- The first signature.signature2- The second signature.- Returns:
- The score for the two signatures. The value is in the range 0..100, where 0 is a terrible match and 100 is a great match.
-
-