CTPH.mjs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @author n1474335 [n1474335@gmail.com]
  3. * @copyright Crown Copyright 2016
  4. * @license Apache-2.0
  5. */
  6. import Operation from "../Operation.mjs";
  7. import ctphjs from "ctph.js";
  8. /**
  9. * CTPH operation
  10. */
  11. class CTPH extends Operation {
  12. /**
  13. * CTPH constructor
  14. */
  15. constructor() {
  16. super();
  17. this.name = "CTPH";
  18. this.module = "Crypto";
  19. this.description = "Context Triggered Piecewise Hashing, also called Fuzzy Hashing, can match inputs that have homologies. Such inputs have sequences of identical bytes in the same order, although bytes in between these sequences may be different in both content and length.<br><br>CTPH was originally based on the work of Dr. Andrew Tridgell and a spam email detector called SpamSum. This method was adapted by Jesse Kornblum and published at the DFRWS conference in 2006 in a paper 'Identifying Almost Identical Files Using Context Triggered Piecewise Hashing'.";
  20. this.infoURL = "https://forensicswiki.org/wiki/Context_Triggered_Piecewise_Hashing";
  21. this.inputType = "string";
  22. this.outputType = "string";
  23. this.args = [];
  24. }
  25. /**
  26. * @param {string} input
  27. * @param {Object[]} args
  28. * @returns {string}
  29. */
  30. run(input, args) {
  31. return ctphjs.digest(input);
  32. }
  33. }
  34. export default CTPH;