Skip to content

Lab 2 — Simple Hash Function

Goal

Implement a simple hash function and find a collision.

External notebooks

  • Notebook 1: https://colab.research.google.com/drive/132exIRjgj0SpNZYyNm4TxAP1TcsN2k0L?usp=sharing
  • Notebook 2: https://colab.research.google.com/drive/1o0S5vRe4BvL9H8j9A3tlf9uIqmASr99M?usp=sharing

Tasks

  1. Implement the provided simple hash function.
  2. Test determinism.
  3. Modify inputs and observe output changes.
  4. Find two different inputs with the same hash output.
  5. Explain why production blockchains use cryptographic hash functions such as SHA-256.

Deliverable

Completed Colab notebook or exported .ipynb file.