Snefru256 Class
Definition
- Namespace
- Bodu.Security.Cryptography
- Assembly
- Bodu.Security.Cryptography.dll
- Package
- Bodu.Security.Cryptography 1.2.0
- Source
- Snefru.256.cs
Computes a 256-bit (32-byte) hash using the Snefru hash algorithm by Ralph Merkle. This class cannot be
inherited.
public sealed class Snefru256 : Snefru, ICryptoTransform, IDisposable
- Inheritance
-
Snefru256
- Implements
- Inherited Members
- Extension Methods
Examples
using Bodu.Security.Cryptography;
using var snefru = new Snefru256();
byte[] digest = snefru.ComputeHash(legacyMessage);
Remarks
Snefru256 maintains an 8-word internal state and absorbs input in 32-byte blocks into a 512-bit working buffer, applying 8 rounds of S-box substitution and word rotation per block. On finalization the state is XOR-folded from the permuted buffer and serialized in big-endian byte order. See Snefru for shared background.
Parameters at a glance.
- Output size: 256 bits (32 bytes).
- Block size: 32 bytes; 8-word internal state; 8 rounds per block.
- Status: broken - practical collision attacks are known.
When to choose Snefru256. Academic study and legacy interop only. For new security-sensitive
256-bit hashing use SHA-256 or Blake2b; for fingerprinting use a 256-bit non-cryptographic hash from
Bodu.IO.Hashing.
important
Snefru is considered broken and not suitable for password hashing, digital signatures, or secure data integrity checks.
Constructors
Snefru256()
Initializes a new instance of the Snefru256 class using a fixed 256-bit output size.
public Snefru256()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |