Skip to content

Custom AES s_box replacement – how to verify and apply correctly? #1319

@hashirhamxa

Description

@hashirhamxa

Hi Crypto++ team,

I am trying to customize AES by using my own s_box. Specifically, I want to replace the default AES s_box with a custom substitution box to experiment with modified encryption behavior.

What I did:
I located the AES s_box in rdtables.cpp and replaced the original sbox array with my own values. However, I'm not sure if this is sufficient for Crypto++ to actually use my modified box.

My Questions:

  1. Does replacing the sbox array in rdtables.cpp automatically update the AES implementation to use my custom box?
  2. Are there any other places in the codebase where I need to modify or regenerate derived tables (like T-tables, inverse s-box, etc.) to reflect my new s_box?
  3. How can I verify that my custom s_box is being used in encryption/decryption operations?
  4. I’m not very familiar with C++, so if there's a build step or regeneration needed, I would really appreciate some guidance on how to do that.
    Thanks a lot in advance for your help!
    Looking forward to learning more about how Crypto++ manages AES internals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions