Skip to content

Issue : Inconsistent Naming for Encryption/Decryption Keys #1

@PrinceSajjadHussain

Description

@PrinceSajjadHussain

The _reset_key method calculates both self._keys and self._keys_inv. The _keys_inv is generated by applying self._mix_cols_inv to all round keys except the first and last. However, in the _keys_inv assignment, the last key in the list doesn't get the _mix_cols_inv applied to it.

self._keys_inv = [self._mix_cols_inv(keys[i]) if (0<i<len(keys)-1) else keys[i] for i in range(len(keys))]

This means the last decryption key is equivalent to the last encryption key. This might lead to incorrect decryption. Specifically, it doesn't align with the inverse operations required in the decryption process, potentially weakening the security of the algorithm. Consider applying the correct inverse operation or ensuring consistency in key generation and usage for both encryption and decryption.

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