Skip to content

Fully consistent 16 byte long nonce - #308

Merged
DigiH merged 1 commit into
theengs:developmentfrom
DigiH:nonce
Aug 6, 2025
Merged

Fully consistent 16 byte long nonce#308
DigiH merged 1 commit into
theengs:developmentfrom
DigiH:nonce

Conversation

@DigiH

@DigiH DigiH commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

For consistency with OMG decryption and general bindkey AES CTR matching.

In Counter (CTR) mode, the nonce (or IV) is combined with a counter that increments with each block of ciphertext being decrypted. The length of the nonce is typically 8 to 16 bytes, depending on the implementation, and pycryptodome allows for nonces of various lengths.

8-byte IV: Some libraries will accept an 8-byte IV (used as the nonce), then increment the counter automatically. This might work if the library’s implementation is flexible, but this is not universal behaviour. Some libraries will throw an error or expect you to provide a full 16-byte IV.

Checklist:

  • I have created the pull request against the latest development branch
  • I have added only one feature/fix per PR and the code change compiles without warnings
  • I accept the Developer Certificate of Origin (DCO).

For consistency with OMG decryption and general bindkey AES CTR matching.

> In Counter (CTR) mode, the nonce (or IV) is combined with a counter that increments with each block of ciphertext being decrypted. The length of the nonce is typically 8 to 16 bytes, depending on the implementation, and pycryptodome allows for nonces of various lengths.

> 8-byte IV: Some libraries will accept an 8-byte IV (used as the nonce), then increment the counter automatically. This might work if the library’s implementation is flexible, but this is not universal behaviour. Some libraries will throw an error or expect you to provide a full 16-byte IV.
@DigiH
DigiH merged commit 47118d9 into theengs:development Aug 6, 2025
6 checks passed
@DigiH
DigiH deleted the nonce branch August 6, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant