Snefru128 Class
Definition
- Namespace
- Bodu.Security.Cryptography
- Assembly
- Bodu.Security.Cryptography.dll
- Package
- Bodu.Security.Cryptography 1.2.0
- Source
- Snefru.128.cs
Computes a 128-bit (16-byte) hash using the Snefru hash algorithm by Ralph Merkle. This class cannot be
inherited.
public sealed class Snefru128 : Snefru, ICryptoTransform, IDisposable
- Inheritance
-
Snefru128
- Implements
- Inherited Members
- Extension Methods
Examples
using Bodu.Security.Cryptography;
using var snefru = new Snefru128();
byte[] digest = snefru.ComputeHash(legacyMessage);
Remarks
Snefru128 maintains a 4-word internal state and absorbs input in 48-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: 128 bits (16 bytes).
- Block size: 48 bytes; 4-word internal state; 8 rounds per block.
- Status: broken - practical collision attacks are known.
When to choose Snefru128. For academic study and interop with archival data only. For new
security-sensitive work use SHA-2 or Blake2b; for 128-bit non-cryptographic fingerprinting use a
Bodu.IO.Hashing algorithm such as MurmurHash3_128.
important
Snefru is considered broken and not suitable for password hashing, digital signatures, or secure data integrity checks.
Constructors
Snefru128()
Initializes a new instance of the Snefru128 class using a fixed 128-bit output size.
public Snefru128()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |