Habr•October 9, 2026•🇷🇺Translated from Russian

Hash Functions Part 1: Core Properties, Security Requirements and Practical Applications

Hash Functions. Part 1: Fundamentals

Hash function is a function that accepts data of arbitrary length and produces a fixed-length output called a hash or digest. In practice, three core security properties must hold: preimage resistance, second-preimage resistance, and collision resistance. In addition, a good hash function exhibits the avalanche effect: the smallest change in input produces an unrecognizable change in output.

What is a Hash Function?

Preimage resistance means it is computationally infeasible to recover the original input from the digest. Second-preimage resistance means that, given an input and its digest, finding a different input that yields the same digest is practically impossible. Collision resistance means finding any two distinct inputs that produce the same digest is infeasible; neither input is fixed in advance.

Methods for Ensuring Hash Function Security

The theoretical properties have practical limits. Input data must possess sufficient entropy and length; otherwise an attacker can precompute hashes for all possible values and reverse the digest. The output size is equally critical. A minimum digest length of 256 bits is now considered mandatory because it delivers 128 bits of security against collision attacks. A 128-bit digest suffices only for the first two properties, since modern hardware cannot exhaust 2^128 possibilities.

The birthday paradox illustrates why 256 bits are required for collision resistance. The question “How many people must be in a room for a 50 percent chance that at least two share a birthday?” yields the answer 23. Mathematically, when sampling from a space of size 2^N, a collision is expected after roughly 2^(N/2) attempts. Therefore a 256-bit digest is needed to obtain 128-bit collision security. Because of insufficient collision resistance, MD5 and SHA-1 are considered broken.

Hash Functions in Practice

Hashing can be performed directly from the command line with OpenSSL:

echo -n "some words" | openssl dgst -sha256

Any supported algorithm may replace sha256, and a file path may be supplied instead of a string.

Hash functions enable commitment schemes: a party hashes secret data, publishes the digest, and later reveals the original value for verification. The function simultaneously hides the secret and binds the committer to the original data. They also protect web subresource integrity. When loading scripts or stylesheets from a CDN, the integrity attribute allows the browser to verify that the received file matches the expected digest:

  • <link rel="stylesheet" href="https://my-provider.com" integrity="sha256-HASH_OF_STYLE" crossorigin="anonymous">
  • <script src="https://my-provider.com" integrity="sha256-HASH_OF_SCRIPT" crossorigin="anonymous"></script>

The most widespread use is password storage with memory-hard functions such as Argon2 and bcrypt. Only the digest is stored; when a user supplies a password it is hashed and compared with the stored value. Because the digest itself must be transmitted securely, a hash function alone does not provide integrity; it must be used within a properly designed protocol.

This concludes Part 1. The next installment will examine the internal structure of SHA-2 and SHA-3, their respective strengths and weaknesses, and the appropriate use of XOF functions.

Related articles

Habr•Other

SberHealth to Host DevOps-Garage Meetup on Infrastructure Security and AI Integration

SberHealth is organizing an online DevOps-garage Meetup scheduled for December 9 from 18:30 to 21:00 Moscow time. The event will examine how complex infrastructure systems are built, the tools selected during development, and the solutions that proved effective in practice. Speakers from SberHealth, SberTech, Kriptonit, and MWS will cover building and scaling data platforms using IaC, GitOps, and open-source tools. Additional topics include multi-layer infrastructure protection methods, deploying Kubernetes in isolated environments, and isolating AI agents within Kubernetes clusters while evaluating sandbox costs. The program also addresses the use of Policy Engine for Kubernetes management in the GenAI era and delegating infrastructure tasks to AI agents. Registration is available via a dedicated link, with contact information provided for those who do not receive confirmation emails.

Habr•Other

Zasechka: Open Source Tool Creates Tamper-Proof Video Timestamps via Bitcoin Blockchain

Zasechka is a new open-source web application that records videos and anchors their timestamps directly into the Bitcoin blockchain using OpenTimestamps. The service performs all encryption locally in the browser with age v1 and X25519 keys derived from a 13-word mnemonic, ensuring no server ever sees the plaintext footage. Before recording, the site fetches the latest Bitcoin block hash and converts its final eight bytes into four random words that the user must speak aloud, establishing a lower time bound that cannot be forged after the fact. After recording, the SHA-256 hash of the encrypted video is submitted to OpenTimestamps, producing an .ots receipt that links the file to a specific Bitcoin block within a 1–6 hour window. The entire workflow runs as a progressive web app on GitHub Pages, requires no accounts, and remains functional offline once installed. Verification happens entirely in the browser: the recipient checks the OpenTimestamps proof against two independent Bitcoin sources and confirms that the spoken words match the block-derived list. The project’s source code and detailed format specification are publicly available on GitHub, inviting community review of the cryptography and any potential weaknesses.

Habr•Other

Ratcast Updates P2P App with Auto Quality Mode, Hardware Encoder Fixes and File Sharing

Ratcast has released a new version of its serverless P2P application focused on voice calls, video conferencing and joint content streaming. The update introduces automatic resolution adaptation that balances network bandwidth and encoder load to maintain optimal image quality without overloading the device. Hardware encoder issues were fixed for both NVENC on Windows and VideoToolbox on macOS, eliminating bitrate deviations that previously caused quality loss or packet loss. Users can now share files directly in chat by dragging them into the window or pasting from the clipboard. Full-screen mode is now available for the local camera in addition to remote participant feeds. Static image handling at high frame rates has also been improved to prevent unnecessary bitrate spikes.

AntiMalware•Other

SberTech Expands AI Agents in Platform V DataSpace to Enable Corporate Application Development from Text Descriptions

SberTech has introduced a new set of skills for its AI agents within the Platform V DataSpace platform, allowing the creation of corporate applications based on textual descriptions. The update focuses on automating the design of architectural components while respecting enterprise environment requirements. Presented at the AI Journey 2026 conference in Moscow, the skills draw from the company's low-code development practices and have been released openly on GitVerse. The AI agents can now handle user interfaces, server-side logic, data models, authorization mechanisms, and access rights. This addresses challenges in vibe coding by providing better architectural control and consistent service structures. According to CEO Maxim Tyatyushev, the capabilities support rapid prototyping, business hypothesis testing, and organizational scaling for both professional developers and non-programmers.