Back

Blog details

What Is AWS Signature Version 4? How S3 Requests Are Signed

AIOZ Network
7 min readNovember 20, 2026
aioz-storage
AWS Signature Version 4: How S3 Requests Are Signed, AIOZ Storage

AWS Signature Version 4 (SigV4) is the protocol that signs S3 and other AWS API requests with an HMAC-SHA256 key derived from your secret key. The server repeats the math to confirm who sent the request and that nobody changed it, so your secret never crosses the network.

TL;DR:

  • SigV4 hashes a normalized copy of your request, wraps it in a string to sign, and signs that with a key derived from your secret, the date, the region and the service.
  • The signature travels in the Authorization header or in the URL query string, which is what a presigned URL is.
  • Common failures are a canonical request that differs from the server's, a wrong region in the scope, and a clock that is more than about 15 minutes off.
  • The AIOZ Storage S3 endpoint expects SigV4 with region us-east-1. In our Oct 29, 2026 tests it rejected timestamps 16 minutes off and chunked uploads without a Content-Length.

What Is AWS Signature Version 4?

AWS describes SigV4 as its protocol for adding authentication information to API requests. The AWS SDKs, the AWS CLI and Postman's AWS Signature auth type all produce it, so S3-compatible services such as AIOZ Storage verify it too. For the wider picture of buckets, keys and requests, start with how S3 object storage works, and our object storage glossary has a short entry for Signature Version 4.

According to the Amazon S3 documentation, a signature does three jobs:

  • It proves identity: only someone holding the secret that matches the access key ID can produce it.
  • It protects the signed parts: change the path, a signed header or a signed body, and the server's signature no longer matches.
  • It limits replay: for S3, the signed parts of a request are valid for 15 minutes from its timestamp.

SigV4 does not encrypt anything, and unsigned parts of a request can still be changed in transit, so AWS recommends signing the headers and body and sending requests over HTTPS. It replaced Signature Version 2, and AWS's troubleshooting guide says services such as S3 no longer accept SigV2.

How Does SigV4 Signing Work?

The client and the server run the same four steps, and only the result of step three goes over the wire.

Diagram of AWS Signature Version 4 signing: 1 canonical request (method, path, query, sorted headers, signed header list, payload hash), 2 string to sign (AWS4-HMAC-SHA256, timestamp, scope date/region/s3/aws4_request, SHA256 of the canonical request), 3 signature as HMAC-SHA256 of the signing key and string to sign, 4 the server rebuilds both strings and compares. The signing key is derived from the secret through date, region, service and aws4_request and is never sent.

1. Build the canonical request: a fixed six-line layout. It lists the HTTP method, the URI-encoded path, the sorted query string, the lowercase sorted headers, the signed header names, and the hex SHA-256 of the body. This one comes from AWS's own GET example, which reads the first 10 bytes of test.txt:

GET
/test.txt

host:examplebucket.s3.amazonaws.com
range:bytes=0-9
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20130524T000000Z

host;range;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

The empty third line is the missing query string, and the long hash is the SHA-256 of an empty body. S3 requires you to sign the host header and every x-amz-* header you send, and to include x-amz-content-sha256 on header-signed requests.

2. Build the string to sign: it holds the algorithm name AWS4-HMAC-SHA256, the timestamp, the credential scope and the SHA-256 of the canonical request. The scope, such as 20130524/us-east-1/s3/aws4_request, ties the signature to one day, one region and one service.

3. Derive the signing key and sign: you never sign with the secret directly; four HMAC-SHA256 steps turn "AWS4" plus your secret into a key for that date, region, service and the literal aws4_request. The HMAC of the string to sign under that key is the 64-character signature.

4. Let the server compare: the server reads the access key ID and scope from your request, rebuilds both strings and computes its own signature, and the request fails if the two differ.

Working Through AWS's Own Signing Example

The quickest way to learn SigV4 is to reproduce AWS's published test value. This script uses only the Python standard library and AWS's documented example key:

import hashlib
import hmac


def hmac_sha256(key, msg):
    return hmac.new(key, msg.encode(), hashlib.sha256).digest()


empty_hash = hashlib.sha256(b"").hexdigest()  # GET has no body

canonical_request = "\n".join([
    "GET",
    "/test.txt",
    "",  # no query string
    "host:examplebucket.s3.amazonaws.com\n"
    "range:bytes=0-9\n"
    f"x-amz-content-sha256:{empty_hash}\n"
    "x-amz-date:20130524T000000Z\n",
    "host;range;x-amz-content-sha256;x-amz-date",
    empty_hash,
])

string_to_sign = "\n".join([
    "AWS4-HMAC-SHA256",
    "20130524T000000Z",
    "20130524/us-east-1/s3/aws4_request",
    hashlib.sha256(canonical_request.encode()).hexdigest(),
])

# AWS's published example secret, not a real key
key = ("AWS4" + "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY").encode()
for part in ["20130524", "us-east-1", "s3", "aws4_request"]:
    key = hmac_sha256(key, part)

print(hmac.new(key, string_to_sign.encode(), hashlib.sha256).hexdigest())

We ran it with Python 3.12.3 on Oct 29, 2026, and it printed f0e8bdb87c964420e857bd35b5d6ed310bd44f0170aba48dd91039c6036bdb41, the signature AWS lists for this request. If your own signer gives a different value for these inputs, the bug is in your code rather than your keys.

Step one has the most rules to get wrong, such as a + instead of %20 for a space, lowercase hex in percent-encoding, or an unsorted query string. S3 also doesn't normalize paths, so my-object//example//photo.user must be signed exactly as written.

Header, Presigned URL and Chunked Signing Modes

The same math supports several ways to carry the signature and the body hash:

  • Authorization header. The most common method, holding the algorithm, Credential=<key id>/<scope>, SignedHeaders and Signature.
  • Query string. The same fields become X-Amz-* URL parameters, capped at 604,800 seconds (7 days) by X-Amz-Expires. Our guide to presigned URLs with Python shows this form on AIOZ Storage.
  • Signed or unsigned payload. x-amz-content-sha256 holds either the body's SHA-256, which the signature then covers, or the literal UNSIGNED-PAYLOAD.
  • Chunked upload. With Content-Encoding: aws-chunked and a STREAMING-* payload value, each chunk carries the signature of the one before it. Some variants add a trailing checksum, the same idea covered in how S3 verifies data integrity.

You rarely pick these by hand, but the SDK's choice matters on S3-compatible endpoints, as the AIOZ results below show.

Why Does a SigV4 Request Fail?

AWS's troubleshooting guide and the S3 error list point to a short set of causes:

  • SignatureDoesNotMatch (403): your canonical request or string to sign differs from the server's. A proxy that rewrites headers causes it too.
  • RequestTimeTooSkewed (403): your clock is too far from the server's, so sync it with NTP.
  • Wrong region or service in the scope: AWS answers with messages such as "Credential should be scoped to a valid Region". On an S3-compatible service, use the region string its docs give.
  • InvalidAccessKeyId (403): the server doesn't know your access key ID, so it never checks the signature.

When you have to sign by hand, test your code against the AWS example above before you suspect your keys.

How AIOZ Storage Handles It

Requests to the AIOZ Storage S3 endpoint, https://s3.aiozstorage.network, are signed with SigV4. Our Postman docs set the AWS Signature auth type with service s3 and region us-east-1, and the Postman walkthrough for the S3 API covers that setup. The Super Intelligence Memory API uses the same scheme with service name s3vectors. You get the key pair by creating an access grant of type S3 Credentials in the dashboard.

A generic SigV4 signer works too. curl has one built in since version 7.75.0:

curl --aws-sigv4 "aws:amz:us-east-1:s3" \
  --user "$AIOZ_ACCESS_KEY:$AIOZ_SECRET_KEY" \
  https://s3.aiozstorage.network/

We have no AIOZ credentials on our test machine, so on Oct 29, 2026 we ran this with curl 8.5.0 and a made-up key pair. The endpoint answered 403 InvalidAccessKeyId, meaning it parsed the signed request and stopped at the key lookup. We then sent hand-signed requests with the same fake key:

Request (fake key, Oct 29, 2026)Response
No signature at all403 AccessDenied
Signed, current time403 InvalidAccessKeyId
Signed, scope region eu-west-1403 InvalidAccessKeyId
Signed, timestamp 14 minutes old403 InvalidAccessKeyId
Signed, timestamp 16 minutes old403 RequestTimeTooSkewed
Signed, timestamp 20 minutes ahead403 RequestTimeTooSkewed
PUT, aws-chunked body, Transfer-Encoding: chunked411 MissingContentLength
PUT, same 5-byte file with a Content-Length403 InvalidAccessKeyId

So the clock window is about 15 minutes, as on S3, and the time check runs before the key lookup. Uploads need a Content-Length, which rules out the chunked mode that recent AWS SDKs use for uploads by default. With boto3, set the client up like this:

import boto3
from botocore.config import Config

s3 = boto3.client(
    "s3",
    region_name="us-east-1",
    endpoint_url="https://s3.aiozstorage.network",
    config=Config(
        signature_version="s3v4",
        request_checksum_calculation="when_required",
        response_checksum_validation="when_required",
        s3={"addressing_style": "path"},
    ),
)

The when_required settings stop boto3 1.36.0 and later from sending uploads chunked without a Content-Length. Path style is needed because bucket subdomains of s3.aiozstorage.network have no DNS record. signature_version="s3v4" keeps presigned URLs on SigV4. These settings come from our earlier fake-key tests on Oct 19 and Oct 28, 2026; a full upload with real keys is still untested.

What the docs don't cover yet: the 15-minute window and the Content-Length rule come from our tests, not AIOZ's docs. A fake key also hides how the endpoint treats a wrong region or a bad signature. To send your first signed request without code, start from the AIOZ Storage Postman docs.

FAQ

Is AWS Signature Version 4 a form of encryption?

No. SigV4 proves who sent a request and that its signed parts are unchanged, but it doesn't hide the content, so use HTTPS for that.

Do you need to sign S3 requests yourself?

Usually not, because the AWS SDKs, the AWS CLI, Postman and curl all sign for you. Hand signing makes sense only when your language has no maintained signer.

Which region should you use for AIOZ Storage?

Use us-east-1 with service s3 for the object API, as AIOZ's Postman docs specify.

How long is a SigV4 signature valid?

For header signing on S3, the signed parts stay valid for 15 minutes from the request timestamp, while a presigned URL can last up to 7 days.

Why does an upload fail with MissingContentLength on an S3-compatible service?

Your SDK is probably streaming the body with aws-chunked encoding and no Content-Length. Set the checksum options to when_required so it sends a normal PUT with a Content-Length.

References

We only send updates when meaningful changes ship, and you can unsubscribe anytime

Related Content

blog thumbnail

Full vs Incremental vs Differential Backup Types Explained

Full vs incremental vs differential backup: what each run copies, how restore chains work, storage and time trade-offs, synthetic fulls and RPO/RTO fit.

aioz-storage
8 min readDecember 04, 2026
blog thumbnail

RAID vs Erasure Coding: Two Ways to Survive Disk Failure

RAID vs erasure coding: RAID guards the disks of one array, while erasure coding spreads k data and m parity pieces over nodes. Compare overhead and rebuilds.

aioz-storage
9 min readDecember 01, 2026
blog thumbnail

What Is Reed-Solomon Coding? The Math Behind Erasure Codes

Reed-Solomon coding turns k data pieces into n, and any k of them rebuild the original. See the polynomial math, GF(2^8), a demo and how AIOZ Storage uses it.

aioz-storage
7 min readNovember 27, 2026
blog thumbnail

RPO vs RTO Explained, With Backup and Restore Examples

RPO vs RTO: RPO caps how much data you can lose, RTO caps how long you can stay down. See how to calculate both, MTD, and the DR strategies that meet them.

aioz-storage
7 min readNovember 24, 2026
blog thumbnail

What Is AWS Signature Version 4? How S3 Requests Are Signed

AWS Signature Version 4 signs each S3 request with an HMAC key derived from your secret. See the four steps, a worked example and the errors that break it.

aioz-storage
7 min readNovember 20, 2026
blog thumbnail

Encryption at Rest vs in Transit, and What Each Protects

Encryption at rest vs in transit: at rest guards stored bytes from stolen disks, in transit guards requests on the network with TLS. See what each one misses.

aioz-storage
7 min readNovember 17, 2026