# SHA-256 Length Extension: Why a Secret-Prefix Hash Is Not a MAC

**URL:** https://www.itechguides.com/community/t/sha-256-length-extension-why-a-secret-prefix-hash-is-not-a-mac/3211
**Category:** Guides
**Created:** [November 7, 2026, 6:14am UTC](https://www.itechguides.com/community/t/sha-256-length-extension-why-a-secret-prefix-hash-is-not-a-mac/3211 "2026-11-07T06:14:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![itechguides](https://www.itechguides.com/community/user_avatar/www.itechguides.com/itechguides/32/8_2.png) [@itechguides](https://www.itechguides.com/community/u/itechguides)
#### Post date: [November 7, 2026, 6:14am UTC](https://www.itechguides.com/community/t/sha-256-length-extension-why-a-secret-prefix-hash-is-not-a-mac/3211/1 "2026-11-07T06:14:29Z")

</div>

A valid SHA-256(secret || message) digest can be extended without recovering the secret. Learn how the padding attack works and why HMAC-SHA-256 avoids it.

The post [SHA-256 Length Extension: Why a Secret-Prefix Hash Is Not a MAC](https://www.itechguides.com/sha-256-length-extension-why-a-secret-prefix-hash-is-not-a-mac/) appeared first on [iTechGuides](https://www.itechguides.com).

* * *
This is a companion discussion topic for the original entry at [https://www.itechguides.com/sha-256-length-extension-why-a-secret-prefix-hash-is-not-a-mac/](https://www.itechguides.com/sha-256-length-extension-why-a-secret-prefix-hash-is-not-a-mac/)
